# will be copied to the output literally
while [ "$in" ]; do
+ [ "$pfx" ] || case $in in
+ [0-9a-fA-F][0-9a-fA-F]*):;;
+ ?*) out="${out}${in%%"${in#?}"}"
+ in="${in#?}"; continue;;
+ esac
+
case $in in
"$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";;
\\*) in="${in#?}"; out="${out}\\\\"; continue;;
str="${str#*${BR}${1}: }"
printf %s "${str%%${BR}*}"
else
- local var="HTTP_$(printf %s "$1" |tr a-z- A-Z-)"
+ local var="HTTP_$(printf %s "$1" |tr a-z- A-Z_)"
eval "[ \"\$$var\" ] && printf %s \"\$$var\" || return 1"
# eval "printf %s \"\$HTTP_$(printf %s "${1}" |tr a-z A-Z |tr -c A-Z _)\""
fi
\]*) out="${out}]"; str="${str#?}";;
"${CR}"*) out="${out}
"; str="${str#?}";;
"${BR}"*) out="${out}
"; str="${str#?}";;
- *) out="${out}${str%%[]&<>\"\'[]*}"; str="${str#"${str%%[]&<>\"\'[]*}"}";;
+ *) out="${out}${str%%[]&<>\"\'${CR}${BR}[]*}"; str="${str#"${str%%[]&<>\"\'${CR}${BR}[]*}"}";;
esac; done
printf %s "$out"
}
\&*) out="${out}%26"; str="${str#?}";;
\"*) out="${out}%22"; str="${str#?}";;
\'*) out="${out}%27"; str="${str#?}";;
+ \`*) out="${out}%60"; str="${str#?}";;
\?*) out="${out}%3F"; str="${str#?}";;
\#*) out="${out}%23"; str="${str#?}";;
\[*) out="${out}%5B"; str="${str#?}";;