Use new helper script to parse header fields

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

@ -1 +1 @@
Subproject commit 0c8aad069620421475301ebc680a2fed8ae829a8 Subproject commit a542830791a18766632a8e73caabf766fbec1a33

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 mobile=1
while [[ $# -gt 0 ]]; do fi
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
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"