diff options
-rw-r--r-- | examples/paste | 6 |
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" |