mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 14:15:49 +03:00
[GH-ISSUE #52] Content type not preserved #2161
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#2161
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 @tschaub on GitHub (Jul 30, 2019).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/52
Thank you for your work on this module - it has made testing with GCS a breeze.
It looks to me like the content type of my objects is not getting preserved. Here is a function that tries to set the content type for a new object and then to get the same from the objects attrs:
I'd expect that to print
content-type: text/html. Instead it printscontent-type:.Let me know if this looks like a bug. I'd be happy to take a pass at a patch.
@fsouza commented on GitHub (Jul 31, 2019):
Hey @tschaub, thanks for reporting this.
Currently fake-gcs-server never sets the content-type. I can look into this before the end of the week, or if you want to take a stab with a PR, the change is unfortunately larger than I'd hope, but we need to add a ContentType field to the fake object, then make sure we set it when creating the object from uploads (there are actually 3 upload methods: simple upload, resumable upload and multipart upload - checkout the
insertObjectmethod). Finally, we need to set the Content-Type header ongetObjectAgain, I can definitely get to this before the end of the week, but I'm also happy to review a PR.
@tschaub commented on GitHub (Aug 7, 2019):
Thanks for the fix @fsouza! This is working well in the v1.11.1 release.