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

Default timeouts and size limits for Deno.serve #25433

Closed
lucacasonato opened this issue Sep 4, 2024 · 1 comment
Closed

Default timeouts and size limits for Deno.serve #25433

lucacasonato opened this issue Sep 4, 2024 · 1 comment
Labels
ext/http related to ext/http feat new feature (which has been agreed to/accepted)
Milestone

Comments

@lucacasonato
Copy link
Member

lucacasonato commented Sep 4, 2024

Deno.serve should have default limits for both accept timeout, TLS handshake timeout, and header read timeout, and response write timeout.

Deno.serve should also have default size limits for req.text, req.bytes, req.arrayBuffer, req.formData, and req.blob. When a user makes a request with a larger body than this default value, we'd error the request. req.body would not be subject to these limits.

The user could customize both timeouts and the size limit in Deno.serve:

Deno.serve({
  maxBodySize: 16 * 1024 * 1024, // 16MiB,
  acceptTimeout: 10000, // 10s
  tlsHandshakeTimeout: 20000, // 20s
  headerReadTimeout: 10000, // 10s,
  responseWriteTimeout: null, // no default
});
@lucacasonato lucacasonato added feat new feature (which has been agreed to/accepted) ext/http related to ext/http labels Sep 4, 2024
@lucacasonato lucacasonato added this to the 2.0.0 milestone Sep 4, 2024
@lucacasonato
Copy link
Member Author

Closing in favor of #3515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext/http related to ext/http feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

No branches or pull requests

1 participant