fix(test): follow redirect with curl -L in test.sh
SABnzbd redirects to /wizard/ on first run (303). Without -L, the test gets the redirect body (no "SABnzbd" text). With -L, curl follows to the wizard page which contains the expected text.
This commit is contained in:
+2
-2
@@ -70,7 +70,7 @@ done
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Test: GET / (SABnzbd web UI)"
|
echo "Test: GET / (SABnzbd web UI)"
|
||||||
RESPONSE=$(curl -s -D - "$BASE_URL/")
|
RESPONSE=$(curl -sL -D - "$BASE_URL/")
|
||||||
STATUS=$(echo "$RESPONSE" | head -1 | grep -oP '\d{3}')
|
STATUS=$(echo "$RESPONSE" | head -1 | grep -oP '\d{3}')
|
||||||
BODY=$(echo "$RESPONSE" | sed -n '/^\r$/,$p' | tail -n +2)
|
BODY=$(echo "$RESPONSE" | sed -n '/^\r$/,$p' | tail -n +2)
|
||||||
|
|
||||||
@@ -79,4 +79,4 @@ assert_match "Body contains SABnzbd" "[Ss][Aa][Bb].*[Nn]zbd" "$BODY"
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Results: $PASSED/$TOTAL passed, $FAILED failed"
|
echo "Results: $PASSED/$TOTAL passed, $FAILED failed"
|
||||||
[ "$FAILED" -eq 0 ]
|
[ "$FAILED" -eq 0 ]
|
||||||
Reference in New Issue
Block a user