mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
If we promise wsgi.input_terminated, we better get it right - or not at all. * chunked encoding on HTTP <= 1.1 * chunked not last transfer coding * multiple chinked codings * any unknown codings (yes, this too! because we do not detect unusual syntax that is still chunked) * empty coding (plausibly harmless, but not see in real life anyway - refused, for the moment)
28 lines
538 B
Python
28 lines
538 B
Python
from gunicorn.config import Config
|
|
|
|
cfg = Config()
|
|
cfg.set("tolerate_dangerous_framing", True)
|
|
|
|
req1 = {
|
|
"method": "POST",
|
|
"uri": uri("/chunked_cont_h_at_first"),
|
|
"version": (1, 1),
|
|
"headers": [
|
|
("TRANSFER-ENCODING", "chunked")
|
|
],
|
|
"body": b"hello world"
|
|
}
|
|
|
|
req2 = {
|
|
"method": "PUT",
|
|
"uri": uri("/chunked_cont_h_at_last"),
|
|
"version": (1, 1),
|
|
"headers": [
|
|
("TRANSFER-ENCODING", "chunked"),
|
|
("CONTENT-LENGTH", "-1"),
|
|
],
|
|
"body": b"hello world"
|
|
}
|
|
|
|
request = [req1, req2]
|