Add explicit zero-body POST transport - #16
Merged
Merged
Conversation
post_json({}) still serializes "{}". post_zero_body sends an empty
string through the existing header, timeout, native, and web paths.
Native empty POST sets Content-Length: 0 only on the Godot path. Web fetch still omits the body, fails closed on opaque and cross-origin redirects, and documents the pre-existing native GET bearer redirect risk.
nicodes
marked this pull request as ready for review
September 27, 2026 01:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HttpClientModule.post_zero_body(endpoint, callback, headers)so a POST can send exactly zero body bytes.post_json({})still serializes and sends{}.Content-Length: 0only on the GodotHTTPRequestpath. Web POST omitsfetchbodyand does not setContent-Length, which browsers forbid. Authorization stays a request header. Timeout and error callbacks are unchanged.redirect: 'manual'. A conforming browser exposes an opaque redirect, so the bridge does not follow it. A visible cross-originLocationis also rejected. Native GET still follows redirects through GodotHTTPRequestand can resendAuthorization, including to another host; this change does not alter that pre-existing behavior.0.0.4.Tests
Content-Length: 0.post_json({})remains 2 bytes.Authorization, zero POST bytes,{}forpost_json({}), callback success, and no sink hit for a cross-origin redirect.