cleaner check for port number when using basic auth #372

This commit is contained in:
soulgalore 2014-02-13 13:12:16 +01:00
parent f231da612b
commit eaa5128a4e
1 changed files with 3 additions and 3 deletions

View File

@ -357,10 +357,10 @@ if [ "$BASIC_AUTH_USER_PASSWORD" != "" ]
local noprotocol=${URL#*//}
local host=${noprotocol%%/*}
local port=${host#*:}
if [[ $port = *[[:digit:]]* ]]; then
echo "using port $port"
else
if [[ $port = *[!0-9]* ]]; then
local port=80
else
echo "using port $port"
fi
BASIC_AUTH_PHANTOMJS="-ba $BASIC_AUTH_USER_PASSWORD"
BASIC_AUTH_CRAWLER="-Dcom.soulgalore.crawler.auth=$host":"$port":"$BASIC_AUTH_USER_PASSWORD"