-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Customize max_line_size and max_field_size in HttpParser? #2988
Comments
Nobody implemented it yet. |
Where would be the best place to expose |
@pposca let's push params into |
@asvetlov OK. There is also a |
Agree, please support |
Guys, any progress with it ? |
The issue is waiting for a champion |
I looked at it a little and found there is such chain Application._make_handler -> Server.call -> RequestHandler -> HttpRequestParser . |
Our project is affected by the issue, and I'd like to open a PR to resolve it. Since 2018 I believe the need is no longer on Application._make_handler and instead to be configured on the ApplicationRunner created here instead. Do you agree? Rather than adding options one-by-one, is there a way we can have many options specified by an application running with GunicornWebWorker? Here are some ideas: Idea 1: A subclass pass extra kwargs to
|
These changes allow the configuration of web.AppRunner object inside application code. This makes possible to use custom configs of Aiohttp server (like 'max_line_size' parameters setup) in pair with Gunicorn. Associated issue: aio-libs#2988 (reference)
I just ran into this when using aiohttp as a client to read from a server which is returning a gigantic CSP header. The source of the problem seems to be here where a hardcoded non-customisable parser is used: aiohttp/aiohttp/client_proto.py Lines 159 to 168 in 43c8168
I can't figure out how to get a override this method properly. It seems like you need a custom connector class providing a custom connection class providing a custom protocol which finally provides a custom parser, but I can't figure it out. Monkey patching HttpResponseParser directly doesn't work, perhaps because of the C extensions. In the end this monkey patch works but I hate it:
|
We're using
aiohttp
2.x with Python 3.5.2 and trying to upgrade to the latest aiohttp 3.2.0 with Python 3.6.5.We're getting errors such as these:
This was happening in aiohttp 2.x as well, because I believe the standard specifies that length as the maximum, however the real world doesn't always agree with standards 😒
To fix this, with aiohttp 2.x we were monkey-patching HttpParser in order to override
max_line_size
andmax_field_size
. Here's the horrible things we've been doing: gist — this file being imported in ourgunicorn_worker.py
.Now that we've upgraded to 3.x, this monkey patching no longer works. Don't know why.
Any way to customize
max_line_size
andmax_field_size
?Possibly without monkey patching, but not necessarily, atm I just want the thing to work?
Environment:
aiohttp.worker.GunicornWebWorker
)See the full requirements.txt if interested.
Cheers,
The text was updated successfully, but these errors were encountered: