fix: avoid binary PDF in command substitution (SIGPIPE)
Docker Build and Push / lint (pull_request) Successful in 8s
Docker Build and Push / build (pull_request) Successful in 1m3s
Docker Build and Push / test (pull_request) Successful in 22s
Docker Build and Push / push (pull_request) Has been skipped

This commit is contained in:
2026-06-08 18:57:24 +00:00
parent fa29bcb2a8
commit fd1dd2e6ca
+2 -3
View File
@@ -69,9 +69,8 @@ assert_match "Body contains redirect to CV" "cabillot_julien_cv.pdf" "$BODY"
echo "" echo ""
echo "Test: GET /cabillot_julien_cv.pdf" echo "Test: GET /cabillot_julien_cv.pdf"
RESPONSE=$(curl -sf -D - "$BASE_URL/cabillot_julien_cv.pdf") STATUS=$(curl -sf -o /dev/null -w '%{http_code}' "$BASE_URL/cabillot_julien_cv.pdf")
STATUS=$(echo "$RESPONSE" | head -1 | grep -oP '\d{3}') CONTENT_TYPE=$(curl -sf -o /dev/null -D - "$BASE_URL/cabillot_julien_cv.pdf" | grep -i 'content-type' | tr -d '\r' | cut -d: -f2- | xargs)
CONTENT_TYPE=$(echo "$RESPONSE" | grep -i 'content-type' | tr -d '\r' | cut -d: -f2- | xargs)
assert "HTTP status is 200" "200" "$STATUS" assert "HTTP status is 200" "200" "$STATUS"
assert_match "Content-Type is application/pdf" "application/pdf" "$CONTENT_TYPE" assert_match "Content-Type is application/pdf" "application/pdf" "$CONTENT_TYPE"