diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 13:42:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 13:42:57 +0000 |
commit | 550d8e8e6ccef95a119bc265101792b0475a7aa0 (patch) | |
tree | fdeb0b5ff80273f95ce61607fc3613dff0b9a235 /test/modules/http2/htdocs/cgi/necho.py | |
parent | Adding upstream version 2.4.57. (diff) | |
download | apache2-550d8e8e6ccef95a119bc265101792b0475a7aa0.tar.xz apache2-550d8e8e6ccef95a119bc265101792b0475a7aa0.zip |
Adding upstream version 2.4.59.upstream/2.4.59upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/modules/http2/htdocs/cgi/necho.py')
-rw-r--r-- | test/modules/http2/htdocs/cgi/necho.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/test/modules/http2/htdocs/cgi/necho.py b/test/modules/http2/htdocs/cgi/necho.py index 78e2aad..715904b 100644 --- a/test/modules/http2/htdocs/cgi/necho.py +++ b/test/modules/http2/htdocs/cgi/necho.py @@ -1,22 +1,7 @@ #!/usr/bin/env python3 import time import os, sys -import multipart -from urllib import parse - - -def get_request_params(): - oforms = {} - if "REQUEST_URI" in os.environ: - qforms = parse.parse_qs(parse.urlsplit(os.environ["REQUEST_URI"]).query) - for name, values in qforms.items(): - oforms[name] = values[0] - myenv = os.environ.copy() - myenv['wsgi.input'] = sys.stdin.buffer - mforms, ofiles = multipart.parse_form_data(environ=myenv) - for name, item in mforms.items(): - oforms[name] = item - return oforms, ofiles +from requestparser import get_request_params forms, files = get_request_params() @@ -55,11 +40,12 @@ Content-Type: text/html\n <p>No count was specified: %s</p> </body></html>""" % (count)) -except KeyError: +except KeyError as ex: print("Status: 200 Ok") - print("""\ + print(f"""\ Content-Type: text/html\n - <html><body> + <html><body>uri: uri={os.environ['REQUEST_URI']} ct={os.environ['CONTENT_TYPE']} ex={ex} + forms={forms} Echo <form method="POST" enctype="application/x-www-form-urlencoded"> <input type="text" name="count"> <input type="text" name="text"> |