diff --git a/sda-download/.github/integration/tests/common/50_check_endpoint.sh b/sda-download/.github/integration/tests/common/50_check_endpoint.sh index c05bee5e4..da754245d 100755 --- a/sda-download/.github/integration/tests/common/50_check_endpoint.sh +++ b/sda-download/.github/integration/tests/common/50_check_endpoint.sh @@ -19,6 +19,17 @@ fi echo "Health endpoint is ok" +check_health_header=$(curl -o /dev/null -s -w "%{http_code}\n" -LI --cacert certs/ca.pem https://localhost:8443/) + +if [ "$check_health_header" != "200" ]; then + echo "Head request to health endpoint does not respond properly" + echo "got: ${check_health_header}" + exit 1 +fi + +echo "Head method health endpoint is ok" + + # ------------------ # Test empty token diff --git a/sda-download/api/api.go b/sda-download/api/api.go index 3c56b5761..a770f5d0a 100644 --- a/sda-download/api/api.go +++ b/sda-download/api/api.go @@ -48,6 +48,7 @@ func Setup() *http.Server { router.HEAD("/s3-encrypted/*path", SelectedMiddleware(), s3.Download) router.GET("/s3-encrypted/*path", SelectedMiddleware(), s3.Download) router.GET("/health", healthResponse) + router.HEAD("/", healthResponse) // Configure TLS settings log.Info("(3/5) Configuring TLS")