test: codify absolute-form and IPv6 authority request-target vectors (phase 2A)

This commit is contained in:
Benoit Chesneau 2026-04-19 10:15:39 +02:00
parent 369b8d7d2c
commit e896a653a4
8 changed files with 69 additions and 0 deletions

View File

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

View 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"",
}

View File

@ -0,0 +1,3 @@
GET http://[::1]:8080/foo HTTP/1.1\r\n
Host: [::1]:8080\r\n
\r\n

View 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"",
}

View File

@ -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

View 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"",
}

View File

@ -0,0 +1,3 @@
CONNECT [::1]:443 HTTP/1.1\r\n
Host: [::1]:443\r\n
\r\n

View 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"",
}