mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 10:11:30 +08:00
Merge pull request #3601 from benoitc/test/rfc9110-body-framing-fixtures
test: codify body-framing cases (RFC 9110 §8.6 & RFC 9112 §6.1)
This commit is contained in:
commit
4da46edac0
@ -0,0 +1,5 @@
|
||||
GET /foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
Content-Length: 5\r\n
|
||||
\r\n
|
||||
hello
|
||||
@ -0,0 +1,16 @@
|
||||
#
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
# RFC 9110 section 8.6: a GET with a non-zero Content-Length is
|
||||
# "discouraged" but not forbidden; the body must be preserved.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("CONTENT-LENGTH", "5"),
|
||||
],
|
||||
"body": b"hello",
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
GET /foo HTTP/1.1\r\n
|
||||
Host: example.com\r\n
|
||||
Content-Length: 0\r\n
|
||||
\r\n
|
||||
15
tests/requests/valid/rfc9110_body_framing_get_cl_zero_01.py
Normal file
15
tests/requests/valid/rfc9110_body_framing_get_cl_zero_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 9110 section 8.6: Content-Length: 0 on GET is valid.
|
||||
request = {
|
||||
"method": "GET",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 1),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("CONTENT-LENGTH", "0"),
|
||||
],
|
||||
"body": b"",
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
POST /foo HTTP/1.0\r\n
|
||||
Host: example.com\r\n
|
||||
Content-Length: 5\r\n
|
||||
\r\n
|
||||
hello
|
||||
16
tests/requests/valid/rfc9110_body_framing_http10_cl_01.py
Normal file
16
tests/requests/valid/rfc9110_body_framing_http10_cl_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 9112 section 6.1: Content-Length is the only framing option for
|
||||
# HTTP/1.0 bodies (chunked was added in HTTP/1.1).
|
||||
request = {
|
||||
"method": "POST",
|
||||
"uri": uri("/foo"),
|
||||
"version": (1, 0),
|
||||
"headers": [
|
||||
("HOST", "example.com"),
|
||||
("CONTENT-LENGTH", "5"),
|
||||
],
|
||||
"body": b"hello",
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user