-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Disable request body data rate limits per HTTP/2 stream #10355
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
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
|
||
MinDataRate IHttpMinRequestBodyDataRateFeature.MinDataRate | ||
{ | ||
get => throw new NotSupportedException(CoreStrings.Http2MinDataRateNotSupported); |
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.
The getter should return null if that's the only allowed value, or it should at least return null if already set to null. Throwing getters are no fun.
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.
The thing is we generally are enforcing a rate limit for HTTP/2. It's just per connection, not per stream. So I don't think it makes sense to return null, but I also don't think it makes sense to return the entire connection's rate limit either.
- The implementations are in Http1Connection and Http2Stream
I'd like to understand how we'll use this in gRPC. I believe we only want to disable the rate limit on gRPC requests. We could be more specific and only disable the rate limit on client or duplex streaming request. Would that be done by setting this feature on the HttpContext with a null MinDataRate on only gRPC client/duplex streaming requests? |
Exactly. Something like https://github.com/aspnet/AspNetCore/pull/10355/files#diff-2d9b5c655816cc6e1ea41260d95cd33eR815 |
Ah, the What happens if you have a HTTP/2 request and someone defines there own |
That's the prerogative of whoever defines their own IHttpMinRequestBodyDataRateFeature. I doubt a custom IHttpMinRequestBodyDataRateFeature would be able to do much with a non-null MinDataRate and an HTTP/2 request unless is measured the rate of the request body itself. |
I expect most people who replace a IHttpMinRequestBodyDataRateFeature would be replacing it with a facade that would call the "real" MinDataRate setter which would throw a NotSupportedException given a non-null rate with HTTP/2. |
Ok. I'm not super familiar with this space, just want to make sure it is thought about. |
Addresses #7635