-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Limit HTTP response size #3553
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
Limit HTTP response size #3553
Changes from all commits
357019a
5c4bd82
d7f53d3
c098475
6f3ffe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,6 +236,8 @@ pub enum ExecutionError { | |
| MaximumServiceOracleExecutionTimeExceeded, | ||
| #[error("Serialized size of the executed block exceeds limit")] | ||
| ExecutedBlockTooLarge, | ||
| #[error("HTTP response exceeds the size limit of {limit} bytes, having at least {size} bytes")] | ||
| HttpResponseSizeLimitExceeded { limit: u64, size: u64 }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we make this a limit for all types of oracle responses?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh right, I'll open an issue to limit the oracle response size as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue #3563 created. |
||
| #[error("Runtime failed to respond to application")] | ||
| MissingRuntimeResponse, | ||
| #[error("Module ID {0:?} is invalid")] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder - could we collect the sizes when we map
response.headers()already? we have the data there (name,value, etc.).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but I think doing it separately is cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but not faster :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Premature optimization is the root of all evil ;)