]> git.plutz.net Git - cgilite/commitdiff
Fix for content-length and cookie variables
authorpaul <paul@plutz.net>
Sun, 3 Jun 2018 13:08:34 +0000 (13:08 +0000)
committerpaul <paul@plutz.net>
Sun, 3 Jun 2018 13:08:34 +0000 (13:08 +0000)
svn path=/trunk/; revision=68

cgilite.sh

index b6ccd7fc4feb25aa2771dc8b9d6547841e150c6d..394bb8f6a24fa4723c3892a0480b82649f802fee 100755 (executable)
@@ -36,9 +36,9 @@ if [ "$1" = '--inetd' -a -z "$REQUEST_METHOD" ]; then
   HTTP_HEADERS="$(sed -u '/^\r\?$/q')"
 
   HTTP_CONTENT_LENGTH="$(printf %s "$HTTP_HEADERS" |grep -oiE '^Content-Length: [0-9]+')"
-  HTTP_CONTENT_LENGTH="${HTTP_CONTENT_LENGTH%%: *}"
+  HTTP_CONTENT_LENGTH="${HTTP_CONTENT_LENGTH##*: }"
   HTTP_COOKIE="$(printf %s "$HTTP_HEADERS" |grep -oiE '^Cookie: [^\r]+')"
-  HTTP_COOKIE="${HTTP_COOKIE%%: *}"
+  HTTP_COOKIE="${HTTP_COOKIE##*: }"
 
   export REMOTE_ADDR SERVER_NAME SERVER_PORT REQUEST_METHOD REQUEST_URI SERVER_PROTOCOL \
          PATH_INFO QUERY_STRING HTTP_CONTENT_LENGTH HTTP_COOKIE