~wallyworld/goose/fix-nil-string-unmarshalling

Viewing all changes in revision 123.

  • Committer: Tarmac
  • Author(s): Kevin McDermott
  • Date: 2014-05-13 08:56:29 UTC
  • mfrom: (119.3.3 goose)
  • Revision ID: tarmac-20140513085629-73yp1ik7s2wh2u5o
[r=jameinel],[bug=1314366] This is a fix for this, basically, this code...

http/client.go

 func (c *Client) sendRequest(method, URL string, reqReader io.Reader, length int, headers http.Header, expectedStatus []int, logger *log.Logger) (*http.Response, error) {

originally, only returned the body of the response, which meant there was no scope for getting the headers.

Coupled with this code from swift/swift.go

-func (c *Client) HeadObject(containerName, objectName string) (headers http.Header, err error)

the fact that it's creating headers here, masks the fact that they're not originating in the request.

I implemented HEAD in the fake server, mainly because it's the quickest way to test the fix, we don't necessarily need HEAD, but we wanted to proxy the headers returned by the Swift request to downstream clients (specifically ETag / cache-control headers).

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: