~mattyw/gomaasapi/fix_for_httptest_build_leak

« back to all changes in this revision

Viewing changes to client.go

  • Committer: Ian Booth
  • Date: 2013-10-17 01:14:45 UTC
  • mfrom: (46.1.1 fix-request-eof)
  • Revision ID: ian.booth@canonical.com-20131017011445-m1hmr0ap14osd7li
Set Close = true on http requests

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
func (client Client) dispatchRequest(request *http.Request) ([]byte, error) {
49
49
        client.Signer.OAuthSign(request)
50
50
        httpClient := http.Client{}
 
51
        // See https://code.google.com/p/go/issues/detail?id=4677
 
52
        // We need to force the connection to close each time so that we don't
 
53
        // hit the above Go bug.
 
54
        request.Close = true
51
55
        response, err := httpClient.Do(request)
52
56
        if err != nil {
53
57
                return nil, err