Skip to content

Commit

Permalink
Merge pull request #2879 from Teko012/2878-add-http-431
Browse files Browse the repository at this point in the history
Fix HTTP status code for Request Header Fields Too Large
  • Loading branch information
benoitc committed Oct 15, 2022
2 parents c9e754e + b42af98 commit 5062a63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Steven Cummings <estebistec@gmail.com>
Sébastien Fievet <zyegfryed@gmail.com>
Talha Malik <talham7391@hotmail.com>
TedWantsMore <TedWantsMore@gmx.com>
Teko012 <112829523+Teko012@users.noreply.github.com>
Thomas Grainger <tagrain@gmail.com>
Thomas Steinacher <tom@eggdrop.ch>
Travis Cline <travis.cline@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions gunicorn/workers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ def handle_error(self, req, client, addr, exc):
elif isinstance(exc, LimitRequestLine):
mesg = "%s" % str(exc)
elif isinstance(exc, LimitRequestHeaders):
reason = "Request Header Fields Too Large"
mesg = "Error parsing headers: '%s'" % str(exc)
status_int = 431
elif isinstance(exc, InvalidProxyLine):
mesg = "'%s'" % str(exc)
elif isinstance(exc, ForbiddenProxyRequest):
Expand Down

0 comments on commit 5062a63

Please sign in to comment.