mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-03 19:21:29 +08:00
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:
commit
ba8776d3fc
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