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
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user