Use new helper script to parse header fields
This commit is contained in:
parent
601ebc27e0
commit
30a865deea
2
bashserv
2
bashserv
@ -1 +1 @@
|
||||
Subproject commit 0c8aad069620421475301ebc680a2fed8ae829a8
|
||||
Subproject commit a542830791a18766632a8e73caabf766fbec1a33
|
@ -7,29 +7,10 @@ if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set -f
|
||||
set $REQUEST_FIELDS
|
||||
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
|
||||
user_agent=$($BASHSERV_DIR/get_request_field.sh "User-Agent")
|
||||
if [[ $user_agent =~ Mobile ]]; then
|
||||
mobile=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$REQUEST_PATH_SANE" -o "$REQUEST_PATH_SANE" == "index.html" ]; then
|
||||
body="<html>\n<head>\n<title>$WAKEBOARD_TITLE</title>\n"
|
||||
|
Loading…
Reference in New Issue
Block a user