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
Hey,
It seems that the REQUEST_MAX_HEADER_SIZE don't rely only Headers size but also on the URL and Method leading to a sanic.exceptions.PayloadTooLarge: Request header exceeds the size limit even if the headers size don't reach the max size: https://github.com/sanic-org/sanic/blob/v23.12.1/sanic/http/http1.py#L172-L197
See the following log with 2 requests with the same headers but with different URL:
This is intended functionality. HTTP/1 header consists of the request line and header lines, that together (also including the newlines that follow) must fit in this limit. Sanic by design cannot make a distinction between different parts of the header. Closing as not a bug.
Is there an existing issue for this?
Describe the bug
Hey,
It seems that the
REQUEST_MAX_HEADER_SIZE
don't rely only Headers size but also on the URL and Method leading to asanic.exceptions.PayloadTooLarge: Request header exceeds the size limit
even if the headers size don't reach the max size: https://github.com/sanic-org/sanic/blob/v23.12.1/sanic/http/http1.py#L172-L197See the following log with 2 requests with the same headers but with different URL:
Code snippet
No response
Expected Behavior
REQUEST_MAX_HEADER_SIZE
should only take into account the HTTP Headers and not raise an Exception if the URL is too long.How do you run Sanic?
As a module
Operating System
Linux
Sanic Version
v23.12.1
Additional context
No response
The text was updated successfully, but these errors were encountered: