fix: Error out when server endpoint ends with a slash (#6981)
This commit is contained in:
parent
49b3a78a0a
commit
a9e46f950b
|
|
@ -43,11 +43,6 @@ else
|
||||||
export $(grep -v '^[[:space:]]*#' ${ENV_FILE} | xargs)
|
export $(grep -v '^[[:space:]]*#' ${ENV_FILE} | xargs)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop and remove existing container
|
|
||||||
# Ignore outcome in case someone decides to set -e later
|
|
||||||
docker rm -f wildcard-nginx || true
|
|
||||||
|
|
||||||
|
|
||||||
default_server_proxy="http://host.docker.internal:8080"
|
default_server_proxy="http://host.docker.internal:8080"
|
||||||
default_client_proxy="http://host.docker.internal:3000"
|
default_client_proxy="http://host.docker.internal:3000"
|
||||||
|
|
||||||
|
|
@ -56,13 +51,22 @@ default_linux_client_proxy="http://localhost:3000"
|
||||||
|
|
||||||
# default server to internal docker
|
# default server to internal docker
|
||||||
server_proxy_pass="${1:-$default_server_proxy}"
|
server_proxy_pass="${1:-$default_server_proxy}"
|
||||||
|
if [[ $server_proxy_pass =~ /$ ]]; then
|
||||||
|
echo "The given server proxy ($1) ends with a '/'. This will change Nginx's behavior in unintended ways." >&2
|
||||||
|
echo "Exiting. Please run again, removing the trailing slash(es) for the server proxy endpoint." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Stop and remove existing container
|
||||||
|
# Ignore outcome in case someone decides to set -e later
|
||||||
|
docker rm -f wildcard-nginx || true
|
||||||
|
|
||||||
uname_out="$(uname -s)"
|
uname_out="$(uname -s)"
|
||||||
vars_to_substitute="$(printf '\$%s,' $(grep -o "^APPSMITH_[A-Z0-9_]\+" ../../.env | xargs))"
|
vars_to_substitute="$(printf '\$%s,' $(grep -o "^APPSMITH_[A-Z0-9_]\+" ../../.env | xargs))"
|
||||||
client_proxy_pass="${default_client_proxy}"
|
client_proxy_pass="${default_client_proxy}"
|
||||||
network_mode="bridge"
|
network_mode="bridge"
|
||||||
case "${uname_out}" in
|
case "${uname_out}" in
|
||||||
Linux*) machine=Linux
|
Linux*)
|
||||||
|
|
||||||
source ../util/is_wsl.sh
|
source ../util/is_wsl.sh
|
||||||
if [ $IS_WSL ]; then
|
if [ $IS_WSL ]; then
|
||||||
|
|
@ -86,7 +90,7 @@ case "${uname_out}" in
|
||||||
visit https://dev.appsmith.com
|
visit https://dev.appsmith.com
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
Darwin*) machine=Mac
|
Darwin*)
|
||||||
echo "
|
echo "
|
||||||
Starting nginx for MacOS...
|
Starting nginx for MacOS...
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user