mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-07 21:21:30 +08:00
test: codify rejection of relative-reference request-target (RFC 9112 section 3.2)
This commit is contained in:
parent
37771e8a44
commit
62252223e0
3
tests/requests/invalid/rfc9112_target_relative_01.http
Normal file
3
tests/requests/invalid/rfc9112_target_relative_01.http
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
GET foo/bar HTTP/1.1\r\n
|
||||||
|
Host: example.com\r\n
|
||||||
|
\r\n
|
||||||
11
tests/requests/invalid/rfc9112_target_relative_01.py
Normal file
11
tests/requests/invalid/rfc9112_target_relative_01.py
Normal 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
|
||||||
Loading…
x
Reference in New Issue
Block a user