diff options
| author | Adam Malczewski <[email protected]> | 2026-03-18 19:15:07 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-18 19:15:07 +0900 |
| commit | 763c5e031f99085e6dace09ff391cdd0177ab5fd (patch) | |
| tree | 549658701bfc313fe8b04d3773dbb7f04be59547 /bin/test.sh | |
| parent | 3961f4121a3774ec4c7a0d1db6dfb2870de31724 (diff) | |
| download | webhook-forwarder-763c5e031f99085e6dace09ff391cdd0177ab5fd.tar.gz webhook-forwarder-763c5e031f99085e6dace09ff391cdd0177ab5fd.zip | |
handle url-encoded webhooks as well
Diffstat (limited to 'bin/test.sh')
| -rwxr-xr-x | bin/test.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/test.sh b/bin/test.sh index ca305aa..b8294de 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -32,4 +32,13 @@ 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!" |
