-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove ContentLengthLimit
#1400
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
Conversation
Yes I think that would be good to add as well. I think that should be its own PR though.
Hm I didn't really consider that. I suppose yes, we would have to add the rejection variants from |
I couldn't find any other nice way of adding |
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.
Looks good!
Wanna update the changelog as well? Then we can merge it 😊
The original implementation of check_max_body_size relied on the size_hint provided by Axum. However, we've encountered instances where check_max_body_size incorrectly returns a BAD_REQUEST response due to inaccurate size_hint values. This commit changes to use `DefaultBodyLimit`, which is the suggestion by axum. See also - tokio-rs/axum#1400 - tokio-rs/axum#1397
The original implementation of check_max_body_size relied on the size_hint provided by Axum. However, we've encountered instances where check_max_body_size incorrectly returns a BAD_REQUEST response due to inaccurate size_hint values. This commit changes to use `DefaultBodyLimit`, which is the suggestion by axum. See also - tokio-rs/axum#1400 - tokio-rs/axum#1397
The original implementation of check_max_body_size relied on the size_hint provided by Axum. However, we've encountered instances where check_max_body_size incorrectly returns a BAD_REQUEST response due to inaccurate size_hint values. This commit changes to use `DefaultBodyLimit`, which is the suggestion by axum. See also - tokio-rs/axum#1400 - tokio-rs/axum#1397
Closes #1399
Before I continue I wanted to ask if the implementation should live in the
Bytes
extractor, and if so should we also check the method likeContentLengthLimit
impl used to? If the impl should live in in the Bytes extractor what with rejections, should I just extend it with the required fields or maybe add one variant toBytesRejection
named something likeBodyLimitRejection
and store more detailed rejection inside that variant?