fix builtin header parsing
authorPaul Hänsch <paul@plutz.net>
Mon, 2 Jul 2018 01:04:55 +0000 (03:04 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 2 Jul 2018 01:04:55 +0000 (03:04 +0200)
cgilite.sh

index 9f2eedc..f0f2fa9 100755 (executable)
@@ -30,7 +30,7 @@ HEADER(){
   # referencing HTTP_* environment variables.
   if [ -n "${cgilite_headers+x}" ]; then
     printf %s "$cgilite_headers" \
-    | sed -rn 's;^'"${1}"': ([^\r]+)\r?$;\1;ip;q;'
+    | sed -rn 's;^'"${1}"': ([^\r]+)\r?$;\1;i; tX; d; :X;p;q;'
   else
     eval "printf %s \"\$HTTP_$(printf %s "${1}" |tr a-z A-Z |tr -c A-Z _)\""
   fi