~go-bot/goose/trunk

  • 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).
Filename Latest Rev Last Changed Committer Comment Size
..
client.go 105.2.1 10 years ago John Arbash Meinel Add another API for NewNonValidatingPublicClient. 12.8 KB Diff Download File
client_test.go 95 11 years ago Ian Booth Add juju-tools keystone endpoint and fix tests 1.1 KB Diff Download File
export_test.go 72.2.7 11 years ago Ian Booth Fix typos 424 bytes Diff Download File
live_test.go 95 11 years ago Ian Booth Add juju-tools keystone endpoint and fix tests 1.4 KB Diff Download File
local_test.go 105.2.1 10 years ago John Arbash Meinel Add another API for NewNonValidatingPublicClient. 13.1 KB Diff Download File