Skip to content

Commit

Permalink
Merge pull request #70 from entando/ENG-5355-force-url-scheme
Browse files Browse the repository at this point in the history
ENG-5355: removes fallback in FORCE_URL_SCHEME
  • Loading branch information
antromeo authored Dec 13, 2023
2 parents 38eefd3 + e300cba commit 6461db6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
15 changes: 7 additions & 8 deletions s/ecr-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ ecr-prepare-action() {
app-get-main-ingresses url_scheme main_ingress ecr_ingress ignored
[ -z "$main_ingress" ] && FATAL "Unable to determine the main ingress url (s1)"
[ -z "$ecr_ingress" ] && FATAL "Unable to determine the ecr ingress url (s1)"
if [ -n "$url_scheme" ]; then
main_ingress="$url_scheme://$main_ingress"
else
case "$FORCE_URL_SCHEME" in
case "$FORCE_URL_SCHEME" in
"http")
http-get-working-url main_ingress "http://$main_ingress" "https://$main_ingress"
url_scheme=http
;;
*)
http-get-working-url main_ingress "https://$main_ingress" "http://$main_ingress"
"https")
url_scheme="https"
;;
esac
esac
if [ -n "$url_scheme" ]; then
main_ingress="$url_scheme://$main_ingress"
fi
[ -z "$main_ingress" ] && FATAL "Unable to determine the main ingress url (s2)"
http-get-url-scheme url_scheme "$main_ingress"
Expand Down
17 changes: 0 additions & 17 deletions s/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -899,23 +899,6 @@ http-get-url-scheme() {
_set_var "$1" "${2//:\/\/*/}"
}

http-get-working-url() {
local res_var="$1"
shift
local res
if http-check "$1" --accept-401; then
res="$1"
else
if http-check "$2" --accept-401; then
res="$2"
else
res=""
fi
fi

_set_var "$res_var" "$res"
}

#-----------------------------------------------------------------------------------------------------------------------
# Retrieve the main application ingresses:
# $1: var for the scheme
Expand Down

0 comments on commit 6461db6

Please sign in to comment.