~tf4/goose/networking-prototype

« back to all changes in this revision

Viewing changes to http/client_test.go

  • Committer: Tarmac
  • Author(s): Ian Booth
  • Date: 2013-10-17 23:10:35 UTC
  • mfrom: (107.1.4 fix-request-eof)
  • Revision ID: tarmac-20131017231035-89gpy8n7g2t928g8
[r=wallyworld],[bug=1239558] Set Close = true on all http requests.

This is needed to avoid this bug in Go's http lib:
https://code.google.com/p/go/issues/detail?id=4677

https://codereview.appspot.com/14769043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
        "bytes"
5
5
        "fmt"
6
6
        "io/ioutil"
 
7
 
7
8
        . "launchpad.net/gocheck"
 
9
 
8
10
        "launchpad.net/goose/testing/httpsuite"
9
11
        "net/http"
10
12
        "testing"
156
158
        c.Check(agent, Equals, "token")
157
159
}
158
160
 
 
161
func (s *HTTPClientTestSuite) TestHttpTransport(c *C) {
 
162
        transport := http.DefaultTransport.(*http.Transport)
 
163
        c.Assert(transport.DisableKeepAlives, Equals, true)
 
164
}
 
165
 
159
166
func (s *HTTPSClientTestSuite) TestDefaultClientRejectSelfSigned(c *C) {
160
167
        _, _, client := s.setupLoopbackRequest()
161
168
        req := &RequestData{ExpectedStatus: []int{http.StatusNoContent}}