summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-07-27 23:24:53 +0200
committertv <tv@krebsco.de>2021-07-27 23:24:53 +0200
commita865757360c3f1b8e0a709ee4ae1ecf65efae65c (patch)
tree63a105818759c10e696894bb74d67ec20d3bf0d1 /examples
parent740d6033323d83f415ee0cb6b482a0c497498b68 (diff)
fix(parse)!: admit query1.3.1
Diffstat (limited to 'examples')
-rw-r--r--examples/paste6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/paste b/examples/paste
index 17f34e9..bec238d 100644
--- a/examples/paste
+++ b/examples/paste
@@ -10,9 +10,11 @@ find_item() {
return 1
}
-case "$Method $Request_URI" in
+abs_path=${Request_URI%%\?*}
+
+case "$Method $abs_path" in
"GET /"[0-9a-z]*)
- if item=$(find_item ${Request_URI#/}); then
+ if item=$(find_item ${abs_path#/}); then
printf 'HTTP/1.1 200 OK\r\n'
printf 'Content-Type: %s\r\n' "$(file -ib $item)"
printf 'Server: %s\r\n' "$Server"