From 17a0b65a4b257c58d97e9748339187d8f557ea96 Mon Sep 17 00:00:00 2001 From: Jack Veney <46730283+jackveney@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:24:27 -0400 Subject: [PATCH] Update endpoint-status.sh Included the -L option in the curl command, ensuring that it will follow any 301 redirects until the final URL is reached. --- Tests/Scripts/endpoint-status.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Scripts/endpoint-status.sh b/Tests/Scripts/endpoint-status.sh index ea4dcd22557..6b248eb11e0 100644 --- a/Tests/Scripts/endpoint-status.sh +++ b/Tests/Scripts/endpoint-status.sh @@ -20,8 +20,8 @@ http_status=0 # Loop until either the endpoint returns 200 or the maximum retries are reached while [ $retries -lt $max_retries ]; do - # Make a curl request and capture the HTTP status code - http_status=$(curl -s -o /dev/null -w "%{http_code}" $endpoint_url) + # Make a curl request and capture the HTTP status code, following redirects + http_status=$(curl -s -o /dev/null -w "%{http_code}" -L $endpoint_url) # Check if the HTTP status code is 200 (OK) if [ $http_status -eq 200 ]; then