Skip to content

Commit

Permalink
Merge pull request #978 from neicnordic/feat/downloand-healthMethodHead
Browse files Browse the repository at this point in the history
Health head request for download
  • Loading branch information
jbygdell authored Aug 8, 2024
2 parents b4ee3f0 + 0c4f396 commit eaf3786
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sda-download/.github/integration/tests/common/50_check_endpoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions sda-download/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit eaf3786

Please sign in to comment.