chore: Fail when backend has a trailing slash (#23437)

This is the same fix from
https://github.com/appsmithorg/appsmith/pull/6981. Unfortunately, looks
like we've missed this and has caused wasted time again.
This commit is contained in:
Shrikant Sharat Kandula 2023-05-17 13:56:23 +05:30 committed by GitHub
parent d1f1a19b66
commit 6dc05d1e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,6 +153,11 @@ rts="http://$rts_host:$rts_port"
http_listen_port="${http_listen_port-80}"
https_listen_port="${https_listen_port-443}"
if [[ $backend =~ /$ ]]; then
echo "The backend endpoint ($backend) 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 backend." >&2
exit 1
fi
if [[ -n ${env_file-} && ! -f $env_file ]]; then
echo "I got --env-file as '$env_file', but I cannot access it." >&2