mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #2130] Regression: UploadObject Ignores -external-url and downgrades to HTTP in v1.53.0 #254
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tobiasf-ps on GitHub (Feb 2, 2026).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/2130
Issue
I've identified a regression in v1.53.0 that breaks HTTPS resumable uploads. When the server is started with a https
-external-url, the initial POST to initiate a resumable upload correctly returns a 200 OK, but the Location header in that response incorrectly specifies a http:// URL, ignoring the -external-url setting.When the client follows this incorrect http:// URL for the subsequent PUT request, the server (correctly) rejects it with a 400 Bad Request and the error Client sent an HTTP request to an HTTPS server.
This behavior did not exist in v1.52.3, where the Location header correctly respected the https:// scheme from the
-external-urlflag.Below is a sample (redacted) request/response I extracted.
Request (note: https)
Response (note: http)
Root cause
I think this is due to the new urlhelper.GetBaseURL function attempting to determine the scheme from the request. However, for a direct HTTPS connection (without a reverse proxy), the X-Forwarded-Proto header is not present, and the r.URL.Scheme field on the incoming http.Request is empty. This causes the helper to fall back to a hardcoded "http" scheme, which is incorrect.
I'm not a Go developer so I'm not able to suggest a fix myself... Gemini has helped me with this though - do with it what you will :P
Thank you for your work on this project!
@fsouza commented on GitHub (Feb 4, 2026):
Thank you for reporting!