mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 06:05:54 +03:00
[GH-ISSUE #631] Support to upload file using signed url, getting 404 #112
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#112
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 @ratnesh93 on GitHub (Dec 9, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/631
Using
generate_upload_signed_url(), I am able to generate signed url which is needed to upload the file,for gcp I am able to upload using
curl -X PUT -H 'Content-Type: text/csv' --data-binary @file_name.csv 'signed_url'But using emular I am not able to upload, its throwing 404
I have created
storage/data/bucket-namefolder.Can anyone guide me, I am doing something wrong, or emulartor does not support upload using signed url.
Please add support to upload file to signed url.
@fsouza commented on GitHub (Dec 9, 2021):
Hmm curious on why it's using
PUT. Can you share a snippet of code reproducing the issue? Which SDK are you using? node.js?Thanks for reporting!
@ratnesh93 commented on GitHub (Dec 10, 2021):
I am using it in python code, code sample is under python section in google docs for
Creating a signed URL to upload an object
Code snippet for upload from google docs which I am using :
MyUseCase: generating signed url for uploading file in gcp, I was using emulator for development purpose via docker image for storage.
And while calling above
generate_upload_signed_url_v4(bucket_name,blob_name)I am able to generate signed url, and when I am trying to upload using postman or curl command from that signed url
curl -X PUT -H 'Content-Type: text/csv' --data-binary @file_name.csv 'signed_url'I was getting error:
storage_1 | time="2021-12-09T10:25:15Z" level=info msg="172.19.0.1 - - [09/Dec/2021:10:25:15 +0000] \"PUT /storage/v1/b/bucket-name/o/file_name.csv?X-Goog-Algorithm=xxx&X-Goog-Credential=xxx&X-Goog-Date=xxx&X-Goog-Expires=1800&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=xxx HTTP/1.1\" 404 59"@fsouza commented on GitHub (Dec 10, 2021):
Oh I see I didn't realize GCS supported
PUTfor uploads too.We need to update the emulator to support that. Should be a simple change, I'll give it a shot.
@toadjaune commented on GitHub (Apr 5, 2022):
Actually, it is already supported : https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/server.go#L266
@fsouza commented on GitHub (Apr 5, 2022):
Oh yeah that's a good point, thanks for updating the docs!
@fsouza commented on GitHub (Apr 5, 2022):
@ratnesh93 can you check if the instructions in #736 work for you?