summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-04-06 14:58:32 +0200
committerYorhel <git@yorhel.nl>2021-04-06 14:58:32 +0200
commitac6243978d587991373ec3e60d3a908bff67d7d8 (patch)
treebd397c09ed9746b0e81e3305d286916f459349d7
parent9e53fe7e8c84e4f49480a5d774e5592647ca35e4 (diff)
Fix bpaste.sh to handle lowercase Location: headerHEADmaster
-rw-r--r--bpaste.sh11
1 files changed, 7 insertions, 4 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#"