File: crash_during_headers.py

package info (click to toggle)
python-legacy-cgi 2.6.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: python: 1,533; makefile: 3
file content (14 lines) | stat: -rwxr-xr-x 353 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3
"""Test CGI script that crashes DURING header output.

This tests cgitb when some headers have been output but the
blank line separating headers from body hasn't been sent yet.
"""
import cgitb

cgitb.enable()

print("Content-Type: text/plain")
print("X-Custom-Header: some-value")

raise ValueError("crash during header output")