File: writecb.py

package info (click to toggle)
waitress 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 988 kB
  • sloc: python: 10,771; makefile: 84; sh: 25
file content (14 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def app(environ, start_response):  # pragma: no cover
    path_info = environ["PATH_INFO"]
    if path_info == "/no_content_length":
        headers = []
    else:
        headers = [("Content-Length", "9")]
    write = start_response("200 OK", headers)
    if path_info == "/long_body":
        write(b"abcdefghij")
    elif path_info == "/short_body":
        write(b"abcdefgh")
    else:
        write(b"abcdefghi")
    return []