diff options
Diffstat (limited to '.rules/changelog/2026-03')
| -rw-r--r-- | .rules/changelog/2026-03/18/03.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.rules/changelog/2026-03/18/03.md b/.rules/changelog/2026-03/18/03.md new file mode 100644 index 0000000..ca69b5b --- /dev/null +++ b/.rules/changelog/2026-03/18/03.md @@ -0,0 +1,28 @@ +# Fix form-urlencoded webhook forwarding to Dokploy + +## Problem + +GitHub webhooks configured with `application/x-www-form-urlencoded` content type +were timing out when forwarded to Dokploy. The JSON content type worked fine. + +## Root Cause + +When converting a form-urlencoded body to JSON for the upstream request: + +1. All original headers (including `Content-Type: application/x-www-form-urlencoded` + and `Content-Length`) were copied to the upstream request builder. +2. `builder.header(Content-Type, "application/json")` **appended** a second + `Content-Type` header instead of replacing the first one. +3. The stale `Content-Length` from the original form-encoded body was forwarded, + but the extracted JSON payload is a different (smaller) size. + +Dokploy received duplicate `Content-Type` headers and an incorrect +`Content-Length`, causing it to misparse the request or hang. + +## Fix + +In `src/main.rs`, when the incoming body is `application/x-www-form-urlencoded`: + +- Skip `Content-Type` and `Content-Length` during the header copy loop. +- Set the correct `Content-Type: application/json` after extracting the payload. +- Let hyper compute `Content-Length` automatically from the actual body. |
