1
0
Fork 0
apache2/test/modules/http2/htdocs/cgi/echohd.py
Daniel Baumann 7263481e48
Adding upstream version 2.4.63.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 11:01:26 +02:00

22 lines
464 B
Python

#!/usr/bin/env python3
import os, sys
from requestparser import get_request_params
forms, files = get_request_params()
name = forms['name'] if 'name' in forms else None
if name:
print("Status: 200")
print("""\
Content-Type: text/plain\n""")
print("""%s: %s""" % (name, os.environ['HTTP_'+name]))
else:
print("Status: 400 Parameter Missing")
print("""\
Content-Type: text/html\n
<html><body>
<p>No name was specified</p>
</body></html>""")