]> git.plutz.net Git - cgilite/blobdiff - cgilite.sh
mime types for streaming formats
[cgilite] / cgilite.sh
index f03f74732165e4d672418d3718ecc228db4ac53d..e145f2eebe173be82475cde1ec60fb200a14ed63 100755 (executable)
@@ -27,6 +27,8 @@ BR='
 '
 cgilite_timeout=2
 
+debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; }
+
 PATH(){ 
   local str seg out
   [ $# -eq 0 ] && str="$(cat)" || str="$*"
@@ -200,6 +202,7 @@ HTML(){
       \'*) out="${out}'";;
       \[*) out="${out}[";;
       \]*) out="${out}]";;
+      "${CR}"*) out="${out}
";;
       "${BR}"*) out="${out}
";;
       *) out="${out}${str%"${str#?}"}";;
     esac
@@ -222,6 +225,8 @@ URL(){
       \[*) out="${out}%5B";;
       \]*) out="${out}%5D";;
       \ *) out="${out}%20";;
+      "        "*) out="${out}%09";;
+      "${CR}"*) out="${out}%0D";;
       "${BR}"*) out="${out}%0A";;
       %*) out="${out}%25";;
       *) out="${out}${str%"${str#?}"}";;