diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py')
-rw-r--r-- | testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py new file mode 100644 index 0000000000..a6b589d2ac --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py @@ -0,0 +1,15 @@ +import re + +def main(request, response): + key = request.GET[b'id'] + action = request.GET[b'action'] + if action == b'put': + # We want the raw input for 'q' + q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0] + request.server.stash.put(key, q) + return [(b"Content-Type", b"text/html")], u'Put %s' % q + else: + q = request.server.stash.take(key) + if q != None: + return [(b"Content-Type", b"text/html")], q + return [], u"" |