Merge lp:~titanous/goamz/s3test-fix-metadata into lp:~gophers/goamz/trunk

Proposed by Jonathan Rudenberg
Status: Merged
Merge reported by: Gustavo Niemeyer
Merged at revision: not available
Proposed branch: lp:~titanous/goamz/s3test-fix-metadata
Merge into: lp:~gophers/goamz/trunk
Diff against target: 12 lines (+1/-1)
1 file modified
s3/s3test/server.go (+1/-1)
To merge this branch: bzr merge lp:~titanous/goamz/s3test-fix-metadata
Reviewer Review Type Date Requested Status
The Go Language Gophers Pending
Review via email: mp+147277@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Good catch, thanks.

Is there anything guaranteeing that this header is in Canonical form by then?

Revision history for this message
Jonathan Rudenberg (titanous) wrote :

I don't think so. It depends on how the req.Header was built, but I suspect that in most cases this will be correct. An alternative is to use strings.ToLower before comparing.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Sounds good. I've merged this, but uses http.CanonicalHeaderKey before the comparison.

Thanks again.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 's3/s3test/server.go'
2--- s3/s3test/server.go 2012-12-10 23:38:27 +0000
3+++ s3/s3test/server.go 2013-02-08 02:43:38 +0000
4@@ -584,7 +584,7 @@
5
6 // PUT request has been successful - save data and metadata
7 for key, values := range a.req.Header {
8- if metaHeaders[key] || strings.HasPrefix(key, "x-amz-meta-") {
9+ if metaHeaders[key] || strings.HasPrefix(key, "X-Amz-Meta-") {
10 obj.meta[key] = values
11 }
12 }

Subscribers

People subscribed via source and target branches