Skip to content

Commit

Permalink
Merge pull request #260 from dkolbly/master
Browse files Browse the repository at this point in the history
Replace "+" in object queries with "%2B"
  • Loading branch information
alimoeeny committed Nov 7, 2014
2 parents d4bb696 + ecb71ce commit 72b2a7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ func partiallyEscapedPath(path string) string {
}
}
}
return strings.Join(pathEscapedAndSplit, "/")
return strings.Replace(strings.Join(pathEscapedAndSplit, "/"), "+", "%2B", -1)
}

// prepare sets up req to be delivered to S3.
Expand Down
11 changes: 11 additions & 0 deletions s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ func (s *S) TestGet(c *check.C) {
c.Assert(string(data), check.Equals, "content")
}

func (s *S) TestGetWithPlus(c *check.C) {
testServer.Response(200, nil, "content")

b := s.s3.Bucket("bucket")
_, err := b.Get("has+plus")

req := testServer.WaitRequest()
c.Assert(err, check.IsNil)
c.Assert(req.RequestURI, check.Equals, "http://localhost:4444/bucket/has%2Bplus")
}

func (s *S) TestURL(c *check.C) {
testServer.Response(200, nil, "content")

Expand Down

0 comments on commit 72b2a7f

Please sign in to comment.