mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #1117] CORS Allow origin #168
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#168
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 @Nicobas on GitHub (Apr 3, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1117
Hi!
My api I generate signed links for download/upload files. When I use these links from my front-end in Vue.js I get CORS errors telling me that the origin is not the right one. fake-gcs-server is running with docker on localhost:8001 and my front-end on localhost:1234. In the code of this project there seems to be an "Access-Control-Allow-Origin: *" rule but it doesn't work. How can I authorize my front end to acces to these ressources?
This is my docker compose config :
Thanks
@fsouza commented on GitHub (May 2, 2023):
Hmm, that should work. Can you provide more details on the error you get from the frontend?
@psigen commented on GitHub (Jan 3, 2024):
I am getting the same error in my frontend. Here is the full line from my browser:
I am testing with the options:
@mattkindy commented on GitHub (Jun 29, 2024):
Similar situation, failed during preflight, attempting to upload to signed url.
Docker Compose
I set up my buckets like
Error
Server Request Log
For fun, I tried changing CORS in bucket creation request to use
host.docker.internal, but this didn't change anything.@mattkindy commented on GitHub (Jun 29, 2024):
Looking at the source code, seems like that's probably related to https://github.com/fsouza/fake-gcs-server/issues/1025 ? Along with
github.com/fsouza/fake-gcs-server@8ffae7259d/fakestorage/server.go (L317)andgithub.com/fsouza/fake-gcs-server@8ffae7259d/fakestorage/server.go (L135)not using the info.@mattkindy commented on GitHub (Jun 29, 2024):
For me, it looked like I had a
x-goog-content-length-rangeheader that was causing it. I was able to work around this by including-cors-headers x-goog-content-length-rangeinto the docker command