mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 14:15:49 +03:00
[GH-ISSUE #315] Crc32c and Md5Hash do not match hashses created from GCS #2213
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#2213
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 @antonydenyer on GitHub (Aug 27, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/315
When hashing the file the hash does not match the one generated by GCS. To reproduce the problem upload a file to GCS and upload the same file to fake-gcs-server. Fetch the object and look metadata and you will notice a different MD5 hash.
You can also reproduce this locally with
gsutil hash -mEssentially:
encodedMd5Hash([]byte("content1")) == "myuzIfXdGoeFfrh1ziL34Q==https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/upload.go#L217
@fsouza commented on GitHub (Aug 27, 2020):
@antonydenyer can you share the script or commands you're using to upload the files? Like, is the process to upload to GCS and fake-gcs-server exactly the same?
"myuzIfXdGoeFfrh1ziL34Q=="is not the correct hash for"content1", it's the hash for"content1\n":@fsouza commented on GitHub (Aug 27, 2020):
(perhaps there's a bug in our backend and it's not preserving the new line at the end of the file, I'll double check that)
@antonydenyer commented on GitHub (Aug 27, 2020):
I take it back! Can't reproduce, must have fat fingered a newline during initial testing.