You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a flag --limit-request-header-count on uvicorn, which I implemented changing the value of an attribute too_many_headers and raising an exception from on_header callback, see https://github.com/encode/uvicorn/pull/1683/files.
My question is: is my implementation as intended? Should the HttpParserCallbackError send more information when an exception happens from one of the callbacks?
It looks like checking the count doesn't make much sense if we can limit the size of the headers. How can I do it for httptools? Should it be on httptools itself?
Activity
Kludex commentedon Oct 2, 2022
It looks like checking the count doesn't make much sense if we can limit the size of the headers. How can I do it for
httptools? Should it be onhttptoolsitself?Kludex commentedon Oct 30, 2022
Ok. Now I understand more. What I did doesn't make any sense.
httptoolsdoes something cool here:httptools/httptools/parser/parser.pyx
Lines 166 to 183 in e2d1a46
Still, I cannot do anything on
uvicornto limit the size of the headers/body, because I need to do it before it's parsed.Ref.: https://github.com/nodejs/node/tree/fd36a8dadba7fcbd74f0ab82a8ee1b3150ce5167/deps/llhttp/src (this is for myself)