mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 10:11:30 +08:00
test: codify field-syntax cases (RFC 9110 section 5.5 and 5.6.2)
This commit is contained in:
parent
5d0f1e9b15
commit
e223e302af
@ -0,0 +1,4 @@
|
||||
GET /foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
X.Custom|Pipe: ok\r\n
|
||||
\r\n
|
||||
16
tests/requests/valid/rfc9110_field_name_special_chars_01.py
Normal file
16
tests/requests/valid/rfc9110_field_name_special_chars_01.py
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9110 section 5.6.2: token = 1*tchar; tchar includes !#$%&'*+-.^_`|~
|
||||
# and alphanumerics. Dot, pipe, and other specials are legal in field-names.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("X.CUSTOM|PIPE", "ok"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
GET /foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
X-Value:\tabc\t\r\n
|
||||
\r\n
|
||||
16
tests/requests/valid/rfc9110_field_value_htab_trim_01.py
Normal file
16
tests/requests/valid/rfc9110_field_value_htab_trim_01.py
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9110 section 5.5: OWS around field-value is optional and not part
|
||||
# of the value; leading and trailing HTAB must be stripped.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("X-VALUE", "abc"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
GET /foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
X-Value: caf\xc3\xa9\r\n
|
||||
\r\n
|
||||
17
tests/requests/valid/rfc9110_field_value_obs_text_01.py
Normal file
17
tests/requests/valid/rfc9110_field_value_obs_text_01.py
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9110 section 5.5: field-vchar = VCHAR / obs-text (0x80-0xFF).
|
||||
# Value carries two obs-text bytes 0xC3 0xA9 (UTF-8 "e"-acute), stored
|
||||
# as latin-1 per the WSGI environ convention.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("X-VALUE", "caf\u00c3\u00a9"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user