Merge pull request #3596 from benoitc/test/rfc9112-relative-target-fixture

test: codify rejection of relative-reference request-target (RFC 9112 §3.2)
This commit is contained in:
Benoit Chesneau 2026-04-19 11:36:57 +02:00 committed by GitHub
commit ba8776d3fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,3 @@
GET foo/bar HTTP/1.1\r\n
Host: example.com\r\n
\r\n

View File

@ -0,0 +1,11 @@
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# RFC 9112 section 3.2: request-target must be one of origin-form,
# absolute-form, authority-form, or asterisk-form. A relative reference
# like "foo/bar" matches none of these and must be rejected.
from gunicorn.http.errors import InvalidRequestLine
request = InvalidRequestLine
# The C parser (gunicorn_h1c) does not yet enforce this rule.
python_only = True