File: 025compat.py

package info (click to toggle)
gunicorn 20.1.0-6%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,512 kB
  • sloc: python: 9,292; makefile: 161; xml: 73; sh: 40; javascript: 35
file content (27 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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]