From 592ee226a49f46f2c74898808ef2d60bcf484147 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 5 Feb 2014 15:08:28 +0100 Subject: [PATCH] removed hardcoded port #295 --- bin/sitespeed.io | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/sitespeed.io b/bin/sitespeed.io index f6c8ef263..6058e22d7 100755 --- a/bin/sitespeed.io +++ b/bin/sitespeed.io @@ -346,14 +346,20 @@ then PROXY_CURL="-x $PROXY_TYPE":"//$PROXY_HOST" fi + if [ "$BASIC_AUTH_USER_PASSWORD" != "" ] then ## Fix for the current version of the crawler - ## TODO also remove the port local noprotocol=${URL#*//} local host=${noprotocol%%/*} + local port=${host#*:} + if [[ $port = *[[:digit:]]* ]]; then + echo "using port $port" + else + local port=80 + fi BASIC_AUTH_PHANTOMJS="-ba $BASIC_AUTH_USER_PASSWORD" - BASIC_AUTH_CRAWLER="-Dcom.soulgalore.crawler.auth=$host":80:"$BASIC_AUTH_USER_PASSWORD" + BASIC_AUTH_CRAWLER="-Dcom.soulgalore.crawler.auth=$host":"$port":"$BASIC_AUTH_USER_PASSWORD" ## BASIC_AUTH_BROWSER_TIME="-p $PROXY_HOST" BASIC_AUTH_CURL="-u $BASIC_AUTH_USER_PASSWORD" fi @@ -420,7 +426,6 @@ if [[ -z $FILE ]] # remove the protocol local noprotocol=${URL#*//} HOST=${noprotocol%%/*} - BASE_DIR=$HOST else echo "Will fetch urls from the file $FILE with User-Agent $USER_AGENT and viewport $VIEWPORT using ruleset $RULESET ... this can take a while" BASE_DIR=$(basename "$FILE")