Use new helper script to parse header fields

This commit is contained in:
2022-03-24 00:09:45 +00:00
parent 601ebc27e0
commit 30a865deea
2 changed files with 5 additions and 24 deletions

View File

@@ -7,29 +7,10 @@ if [ $? -eq 0 ]; then
exit 0 exit 0
fi fi
set -f user_agent=$($BASHSERV_DIR/get_request_field.sh "User-Agent")
set $REQUEST_FIELDS if [[ $user_agent =~ Mobile ]]; then
set +f
while [[ $# -gt 0 ]]; do
length="$1"
key="$2"
shift
shift
value=""
for i in $(seq 1 $length); do
value+="$1 "
shift
done
case $key in
User-Agent)
if [[ $value =~ Mobile ]]; then
mobile=1 mobile=1
fi fi
;;
esac
done
if [ -z "$REQUEST_PATH_SANE" -o "$REQUEST_PATH_SANE" == "index.html" ]; then if [ -z "$REQUEST_PATH_SANE" -o "$REQUEST_PATH_SANE" == "index.html" ]; then
body="<html>\n<head>\n<title>$WAKEBOARD_TITLE</title>\n" body="<html>\n<head>\n<title>$WAKEBOARD_TITLE</title>\n"