Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable arity limit in HTTP clients #1638

Open
kubukoz opened this issue Jan 24, 2025 · 0 comments
Open

Disable arity limit in HTTP clients #1638

kubukoz opened this issue Jan 24, 2025 · 0 comments

Comments

@kubukoz
Copy link
Member

kubukoz commented Jan 24, 2025

Currently, we have maxArity set to 1024 (the default). This is true for both simpleRestJson clients and servers.

The limit arguably doesn't make as much sense on the client as on the server, because we (hopefully) know whom we're calling, and trust that they're not going to DDOS us - so the default limit should be removed.

I'm not sure how easy it'll be without changing the current APIs, because it'd have to be applied to clients only, and currently the config is shared:

def withMaxArity(maxArity: Int): SimpleRestJsonBuilder =
new SimpleRestJsonBuilder(
simpleRestJsonCodecs.transformJsonCodecs(
_.configureJsoniterCodecCompiler(_.withMaxArity(maxArity))
)
)

The behavior should be:

  • SimpleRestJsonBuilder.client(...).build - uses Int.MaxValue
  • SimpleRestJsonBuilder.withMaxArity(1024).client(...).build - uses 1024 (current behavior)
  • SimpleRestJsonBuilder.routes(...).build - uses 1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant