mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[PR #1519] [MERGED] Remove unnecessary quoting around ETag in JSON response #1571
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#1571
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/1519
Author: @manuteleco
Created: 3/8/2024
Status: ✅ Merged
Merged: 3/13/2024
Merged by: @fsouza
Base:
main← Head:fix_etag_rendering_in_response📝 Commits (1)
621ef3cRemove unnecessary quoting around ETag in JSON response📊 Changes
5 files changed (+5 additions, -5 deletions)
View changed files
📝
fakestorage/object.go(+1 -1)📝
fakestorage/object_test.go(+1 -1)📝
fakestorage/upload.go(+1 -1)📝
internal/backend/fs.go(+1 -1)📝
internal/backend/memory.go(+1 -1)📄 Description
The JSON marshaller will already escape the value appropriately. Quoting the value explicitly beforehand is counterproductive, as the quotes introduced in that step would be considered legitimate part of the ETag value and would be themselves escaped when marshalling.
When setting the
ETagHTTP response header, however, we do have to explicitly add the quoting. This is because double quotes are not added automatically for HTTP headers and, according to the standard, theETagheader value must be wrapped in double quotes.Fixes #1327
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.