Skip to content
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

--limit-request-line check default to MAX_REQUEST_LINE #3171

Open
ChristfriedBalizou opened this issue Mar 22, 2024 · 2 comments
Open

--limit-request-line check default to MAX_REQUEST_LINE #3171

ChristfriedBalizou opened this issue Mar 22, 2024 · 2 comments

Comments

@ChristfriedBalizou
Copy link

Increasing the limit request line above the MAX_REQUEST_LINE will default to MAX_REQUEST_LINE.

https://github.com/benoitc/gunicorn/blob/88fc4a43152039c28096c8ba3eeadb3fbaa4aff9/gunicorn/http/message.py#L249C9-L253C55

    # get max request line size
    self.limit_request_line = cfg.limit_request_line
    if (self.limit_request_line < 0
                or self.limit_request_line >= MAX_REQUEST_LINE):
            self.limit_request_line = MAX_REQUEST_LINE

This is an issue because the other option is to set the limit_request_line to 0 to make it unlimited. Is this configuration aimed to be 0 or less than MAX_REQUEST_LINE?

Can a higher limit be set as in Nginx? If so, I would be happy to submit a PR.

@pajod
Copy link
Contributor

pajod commented Apr 22, 2024

Linking commit d79ff99 and comment b7b0979#r2629719 for easier inquiry into why it was swapped around.

Imho capping both lower and upper bound are wrong, we should just respect what was configured - using a default >=8000 only if unset.

@ChristfriedBalizou
Copy link
Author

Completely agree with you @pajod and I think that's what we should head for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants