File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,9 +47,14 @@ echo "window.DRAWIO_SERVER_URL = '${DRAWIO_SERVER_URL}';" >> $CATALINA_HOME/weba
4747echo " window.DRAWIO_BASE_URL = '${DRAWIO_BASE_URL_VALUE} ';" >> $CATALINA_HOME /webapps/draw/js/PreConfig.js
4848
4949# Dynamically update Tomcat context path if DRAWIO_SERVER_URL ends in a subpath
50- CONTEXT_PATH=$( echo " ${DRAWIO_SERVER_URL} " | awk -F' /' ' {print "/"$NF}' | sed -E ' s/[?#].*$//;s/\/$//' )
50+ URL_PATH=$( echo " ${DRAWIO_SERVER_URL} " | sed -E ' s|^https?://[^/]+||; s|[?#].*$||; s|/$||' )
51+ if [ -z " $URL_PATH " ]; then
52+ CONTEXT_PATH=" "
53+ else
54+ CONTEXT_PATH=" /$( basename " $URL_PATH " ) "
55+ fi
5156
52- if [ -n " $DRAWIO_SERVER_URL " ] && [ " $CONTEXT_PATH " != " / " ]; then
57+ if [ -n " $DRAWIO_SERVER_URL " ] && [ -n " $CONTEXT_PATH " ]; then
5358 echo " Updating Tomcat context path to '${CONTEXT_PATH} '"
5459 xmlstarlet ed -P -S -L \
5560 -u ' /Server/Service/Engine/Host/Context/@path' -v " ${CONTEXT_PATH} " \
@@ -199,4 +204,4 @@ if [ -f $CATALINA_HOME/.keystore ] && [ -z $VAR ]; then
199204fi
200205
201206
202- exec " $@ "
207+ exec " $@ "
You can’t perform that action at this time.
0 commit comments