mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[PR #659] [MERGED] Add "internal config update" endpoint to set externalUrl property after the fake server start #803
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#803
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?
📋 Pull Request Information
Original PR: https://github.com/fsouza/fake-gcs-server/pull/659
Author: @sergseven
Created: 1/25/2022
Status: ✅ Merged
Merged: 1/28/2022
Merged by: @fsouza
Base:
main← Head:upload-content-fix📝 Commits (10+)
8406bd2modify image name to sergseven7364662return PublicURL() as location response header5b2e005add .tool-versions48415adrevert 'return PublicURL() as location response header'cb138c0add internal update server config endpoint713f68drevert wrong test case8d70a63remove if body != nil since always non-nilee92c00fix examples to set a real external urleb1fce8fix test case name26586c0remove redundant return📊 Changes
13 files changed (+655 additions, -1 deletions)
View changed files
📝
.github/workflows/main.yml(+3 -0)📝
README.md(+1 -1)➕
ci/run-java-example.sh(+12 -0)📝
examples/go/main.go(+21 -0)➕
examples/java/.gitignore(+2 -0)➕
examples/java/.mvn/wrapper/maven-wrapper.properties(+2 -0)➕
examples/java/README.md(+105 -0)➕
examples/java/mvnw(+310 -0)➕
examples/java/pom.xml(+71 -0)➕
examples/java/src/test/java/com/fsouza/fakegcsserver/java/examples/FakeGcsServerTest.java(+47 -0)➕
fakestorage/config.go(+26 -0)📝
fakestorage/server.go(+5 -0)📝
fakestorage/server_test.go(+50 -0)📄 Description
This change is dedicated to the problem with resumable uploads where it's necessary for fake-gcs-server to respond with "content" HTTP header with external URL which has to be accessible from storage client uses this fake server.
The suggested solution is to specify "external-url" at the endpoint command with the URL this fake server is accessible.
It works for a regular case for local development, but it's getting more difficult when server is hosted on a container, (particularly using https://www.testcontainers.org/) so external URL is different than "public URL" fake-gcs-server" exposes.
Example:
The solution proposed is to modify fake-gcs-server configuration AFTER the container is eventually started and container IP is known:
See the full example at https://github.com/sergseven/fake-gcs-server/blob/upload-content-fix/examples/java/README.md#resumable-upload-operations-and-containerised-fake-gcs-server
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.