From 763c5e031f99085e6dace09ff391cdd0177ab5fd Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Wed, 18 Mar 2026 19:15:07 +0900 Subject: handle url-encoded webhooks as well --- bin/test.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin/test.sh') diff --git a/bin/test.sh b/bin/test.sh index ca305aa..b8294de 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -31,5 +31,14 @@ echo "=== Test 5: POST to nested invalid path should return 404 ===" STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$BASE/foo/bar/baz") echo "POST /foo/bar/baz -> $STATUS (expect 404)" +echo "" +echo "=== Test 6: POST form-urlencoded payload should be converted to JSON ===" +PAYLOAD=$(python3 -c "import urllib.parse; print(urllib.parse.urlencode({'payload': '{\"ref\":\"refs/heads/main\"}'}))") +RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE/test-token" -H "Content-Type: application/x-www-form-urlencoded" -H "X-GitHub-Event: push" -d "$PAYLOAD") +STATUS=$(echo "$RESP" | tail -1) +BODY=$(echo "$RESP" | head -n -1) +echo "POST /test-token (form-urlencoded) -> $STATUS (expect 502 if Dokploy unreachable, or upstream status)" +echo "Body: $BODY" + echo "" echo "Done!" -- cgit v1.2.3