From 6e894fc196d1a31fbc9d15c01c9ee91b26a21714 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 20 Jun 2019 15:28:05 +0100 Subject: [PATCH] [ACA-2470] encode urls for docker entrypoint --- docker/entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ce49ba3a7..061618081 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -60,7 +60,9 @@ if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then fi if [[ $ACSURL ]]; then - sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /tmp/app.config.json && \ + replace="\/" + encoded=${ACSURL//\//$replace} + sed -i s%{protocol}//{hostname}{:port}%"$encoded"%g /tmp/app.config.json && \ cat /tmp/app.config.json > ./app.config.json fi @@ -70,7 +72,9 @@ if [[ $BASEPATH ]]; then fi if [ -n "${APP_BASE_SHARE_URL}" ];then - sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \ + replace="\/" + encoded=${APP_BASE_SHARE_URL//\//$replace} + sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \ -i /tmp/app.config.json && \ cat /tmp/app.config.json > ./app.config.json fi