mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
test: codify absolute-form and IPv6 authority request-target vectors (phase 2A)
This commit is contained in:
parent
369b8d7d2c
commit
e896a653a4
@ -0,0 +1,3 @@
|
||||
GET https://example.com/foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
\r\n
|
||||
14
tests/requests/valid/rfc9112_target_absolute_https_01.py
Normal file
14
tests/requests/valid/rfc9112_target_absolute_https_01.py
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9112 section 3.2.2: absolute-form with https scheme (proxy requests).
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("https://example.com/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
GET http://[::1]:8080/foo HTTP/1.1\r\n
|
||||
Host: [::1]:8080\r\n
|
||||
\r\n
|
||||
15
tests/requests/valid/rfc9112_target_absolute_ipv6_01.py
Normal file
15
tests/requests/valid/rfc9112_target_absolute_ipv6_01.py
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9112 section 3.2.2 + RFC 3986 section 3.2.2: absolute-form with an
|
||||
# IP-literal (IPv6) host wrapped in brackets.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("http://[::1]:8080/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "[::1]:8080"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
GET http://user:pass@example.com:8080/foo?q=1 HTTP/1.1\r\n
|
||||
Host: example.com:8080\r\n
|
||||
\r\n
|
||||
14
tests/requests/valid/rfc9112_target_absolute_userinfo_01.py
Normal file
14
tests/requests/valid/rfc9112_target_absolute_userinfo_01.py
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9112 section 3.2.2: absolute-form with userinfo and explicit port.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("http://user:pass@example.com:8080/foo?q=1"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com:8080"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
CONNECT [::1]:443 HTTP/1.1\r\n
|
||||
Host: [::1]:443\r\n
|
||||
\r\n
|
||||
14
tests/requests/valid/rfc9112_target_authority_ipv6_01.py
Normal file
14
tests/requests/valid/rfc9112_target_authority_ipv6_01.py
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9112 section 3.2.3: authority-form with IPv6 literal, used by CONNECT.
|
||||
request = {
|
||||
"method": "CONNECT",
|
||||
"uri": uri("[::1]:443"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "[::1]:443"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user