Skip to content

fix: resolve upload redirects before streaming - #279

Merged
r3inbowari merged 1 commit into
showwin:masterfrom
wakamex:fix-upload-redirects
Sep 1, 2026
Merged

r3inbowari merged 1 commit into
showwin:masterfrom
wakamex:fix-upload-redirects

Conversation

@wakamex

@wakamex wakamex commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Bell Ottawa server 54836 advertises an HTTP upload URL that redirects to an HTTPS Ookla host. The server closes the connection while the request body is still streaming, so the Go client gets broken pipe before it can receive and follow the 307. The result is Upload: N/A with 0 bytes confirmed.

This resolves the upload URL once with a HEAD request before starting the upload workers. The payload is then sent directly to the final endpoint, and TCP tests are unchanged.

I tested with:

speedtest-go --server 54836 --thread 16 --no-download
Before: Upload: N/A (Used: 0.00MB Confirmed: 0.0%)
After:  Upload: 1026.86 Mbps (Used: 1310.33MB Confirmed: 98.9%)

Also passed:

go test ./...
go vet ./...
go test -race ./speedtest -run "TestResolveUploadURLFollowsTemporaryRedirect|TestUploadRequest"

@r3inbowari

Copy link
Copy Markdown
Collaborator

Good work! can we merge it now? @wakamex

@r3inbowari
r3inbowari self-requested a review September 1, 2026 06:21
@r3inbowari
r3inbowari merged commit 0576a2c into showwin:master Sep 1, 2026
@r3inbowari

Copy link
Copy Markdown
Collaborator

thank you!

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