Etag support - #742
Merged
Merged
Conversation
fsouza
reviewed
Apr 7, 2022
fsouza
left a comment
Owner
There was a problem hiding this comment.
Thanks for contributing, just some nits on how we quote the string!
| Crc32c: checksum.EncodedCrc32cChecksum(data), | ||
| Md5Hash: checksum.EncodedMd5Hash(data), | ||
| Md5Hash: md5Hash, | ||
| Etag: fmt.Sprintf("\"%s\"", md5Hash), |
Owner
There was a problem hiding this comment.
nit:
Suggested change
| Etag: fmt.Sprintf("\"%s\"", md5Hash), | |
| Etag: fmt.Sprintf("%q", md5Hash), |
| Crc32c: checksum.EncodedCrc32cChecksum(data), | ||
| Md5Hash: checksum.EncodedMd5Hash(data), | ||
| Md5Hash: md5Hash, | ||
| Etag: fmt.Sprintf("\"%s\"", md5Hash), |
Owner
There was a problem hiding this comment.
Suggested change
| Etag: fmt.Sprintf("\"%s\"", md5Hash), | |
| Etag: fmt.Sprintf("%q", md5Hash), |
| Crc32c: checksum.EncodedCrc32cChecksum(data), | ||
| Md5Hash: checksum.EncodedMd5Hash(data), | ||
| Md5Hash: md5Hash, | ||
| Etag: fmt.Sprintf("\"%s\"", md5Hash), |
Owner
There was a problem hiding this comment.
Suggested change
| Etag: fmt.Sprintf("\"%s\"", md5Hash), | |
| Etag: fmt.Sprintf("%q", md5Hash), |
| Crc32c: checksum.EncodedCrc32cChecksum(content), | ||
| Md5Hash: checksum.EncodedMd5Hash(content), | ||
| Md5Hash: md5Hash, | ||
| Etag: fmt.Sprintf("\"%s\"", md5Hash), |
Owner
There was a problem hiding this comment.
Suggested change
| Etag: fmt.Sprintf("\"%s\"", md5Hash), | |
| Etag: fmt.Sprintf("%q", md5Hash), |
| obj.Content = append(obj.Content, content...) | ||
| obj.Crc32c = checksum.EncodedCrc32cChecksum(obj.Content) | ||
| obj.Md5Hash = checksum.EncodedMd5Hash(obj.Content) | ||
| obj.Etag = fmt.Sprintf("\"%s\"", obj.Md5Hash) |
Owner
There was a problem hiding this comment.
Suggested change
| obj.Etag = fmt.Sprintf("\"%s\"", obj.Md5Hash) | |
| obj.Etag = fmt.Sprintf("%q", obj.Md5Hash) |
Contributor
Author
|
Yep, you're right, totally forgot about |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! Thanks for the project, it's very useful!
This PR adds Etags support. I'm not sure I patched everything I should yet this works for me, so maybe someone would find this useful.