diff --git a/healthcheck.sh b/healthcheck.sh index 7af3db58..d21acb77 100644 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -2,6 +2,7 @@ set -euuo pipefail LOCAL_PORT="${YTP_PORT:-8081}" +BASE_PATH="${YTP_BASE_PATH:-/}" curl_args=(-f) @@ -10,5 +11,8 @@ if [[ -n "${YTP_AUTH_USERNAME:-}" && -n "${YTP_AUTH_PASSWORD:-}" ]]; then curl_args+=(-H "Authorization: Basic ${cred}") fi -curl_args+=("http://localhost:${LOCAL_PORT}/api/ping") +# strip trailing slashes from BASE_PATH +BASE_PATH=$(echo "${BASE_PATH}" | sed 's:/*$::') + +curl_args+=("http://localhost:${LOCAL_PORT}${BASE_PATH}/api/ping") /usr/bin/curl "${curl_args[@]}"