Skip to content

fix(client): declare Content-Length on gateway uploads - #460

Merged
neilmartin83 merged 1 commit into
fix/package-upload-unverified-hash-stackedfrom
fix/gateway-upload-content-length
Oct 29, 2026
Merged

neilmartin83 merged 1 commit into
fix/package-upload-unverified-hash-stackedfrom
fix/gateway-upload-content-length

Conversation

@neilmartin83

Copy link
Copy Markdown
Member

Stacked on fix/package-upload-unverified-hash-stacked.

Summary

  • Client.Upload on the platform gateway stays on HTTP/1.1 but now sends the caller's Content-Length instead of forcing a chunked body. This matches jamfplatform-go-sdk's multipart uploads (feat(client)!: declare Content-Length on every multipart upload, never chunked jamf/jamfplatform-go-sdk#114).
  • It covers every gateway upload in one place: pro packages upload and the generated icon, branding, enrollment-customization, extension-attribute, inventory-preload and prestage uploads.
  • Direct instance connections are unchanged (h2, declared length).
  • wireLength is removed, since it always equalled contentLength. A caller passing -1 is still sent chunked, and -v labels that chunked.

Evidence

20 MiB random body on the EU gateway (7 ms RTT), 2026-10-26, a new connection per upload, 8 rounds, every upload returned 201:

variant MiB/s
HTTP/1.1 + Content-Length 8.1–9.1
HTTP/1.1 chunked 7.6–9.4
HTTP/2 + Content-Length 4.0–9.2, under 5 in 3 of 8 runs
HTTP/2 chunked 3.5–9.1, under 4 in 5 of 8 runs

Test plan

  • make test
  • make lint
  • TestUpload_GatewayIsHTTP1WithLength (renamed from TestUpload_GatewayIsHTTP1Chunked) asserts h1 + a declared length against a TLS server that offers h2

🤖 Generated with Claude Code

Upload on the platform gateway still goes over HTTP/1.1 but now sends the
Content-Length its caller computed instead of forcing a chunked body, matching
jamfplatform-go-sdk's own multipart uploads. Direct instance connections are
unchanged (h2, declared length).

Measured 2026-10-26 on the EU gateway (7 ms RTT, 20 MiB random body, fresh
connection per upload, 8 rounds): HTTP/1.1 8.1-9.1 MiB/s declared and 7.6-9.4
chunked, so framing makes no measurable difference; HTTP/2 3.5-9.2 MiB/s with
7 of 16 runs under 5 MiB/s, so HTTP/1.1 stays.

wireLength is gone, since it now always equals contentLength. A caller passing
-1 is still sent chunked, and -v labels that "chunked".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@neilmartin83
neilmartin83 force-pushed the fix/gateway-upload-content-length branch from dfc8600 to 5edefb1 Compare October 28, 2026 18:17
@neilmartin83
neilmartin83 merged commit bc7b482 into main Oct 29, 2026
5 checks passed
@neilmartin83
neilmartin83 deleted the fix/gateway-upload-content-length branch October 29, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants