summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpaste.sh11
-rwxr-xr-xindex.cgi2
2 files changed, 8 insertions, 5 deletions
diff --git a/bpaste.sh b/bpaste.sh
index a704de5..234c192 100644
--- a/bpaste.sh
+++ b/bpaste.sh
@@ -14,6 +14,9 @@
# projects@yorhel.nl
# License: MIT
#
+# 0.7 - 2021-04-06
+# - Fix handling of lowercase Location: header
+#
# 0.6 - 2018-01-21
# - Display absolute URL even when the server gives a relative redirect
#
@@ -43,7 +46,7 @@ SYNTAX=nosyntax
FILE=-
WRAP=0
CLICK=1
-VERSION=0.6
+VERSION=0.7
showhelp() {
@@ -88,6 +91,6 @@ PASS=
curl -si -A "bpaste $VERSION" -F "f=<$TMPFILE" -F "s=$SYNTAX" -F "w=$WRAP" -F "c=$CLICK" -F "p=$PASS" $HOST\
- | grep 'Location: '\
- | sed 's/^Location: http/http/'\
- | sed "s#^Location: /#$HOST#"
+ | grep -i 'Location: '\
+ | sed 's/^[Ll]ocation: http/http/'\
+ | sed "s#^[Ll]ocation: /#$HOST#"
diff --git a/index.cgi b/index.cgi
index 16a708a..10185a2 100755
--- a/index.cgi
+++ b/index.cgi
@@ -28,7 +28,7 @@ TUWF::set(
TUWF::hook before => sub {
- return 0 if tuwf->{_TUWF}{http} && tuwf->resFile('.', tuwf->reqPath);
+ tuwf->done if tuwf->{_TUWF}{http} && tuwf->resFile('.', tuwf->reqPath);
tuwf->dbh->sqlite_busy_timeout(10000);
tuwf->dbExec(q(