Переглянути джерело

transport: set Response.TLS/Request

Blake Mizerany 11 роки тому
батько
коміт
8e4032f957
2 змінених файлів з 4 додано та 2 видалено
  1. 4 1
      transport.go
  2. 0 1
      transport_test.go

+ 4 - 1
transport.go

@@ -194,7 +194,10 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
 		return nil, cc.werr
 		return nil, cc.werr
 	}
 	}
 
 
-	return <-cs.resc, nil
+	resp := <-cs.resc
+	resp.Request = req
+	resp.TLS = &state
+	return resp, nil
 }
 }
 
 
 func (cc *clientConn) encodeHeaders(req *http.Request) []byte {
 func (cc *clientConn) encodeHeaders(req *http.Request) []byte {

+ 0 - 1
transport_test.go

@@ -37,7 +37,6 @@ func TestTransportExternal(t *testing.T) {
 }
 }
 
 
 func TestTransport(t *testing.T) {
 func TestTransport(t *testing.T) {
-	condSkipFailingTest(t)
 	const body = "sup"
 	const body = "sup"
 	st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {
 	st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {
 		io.WriteString(w, body)
 		io.WriteString(w, body)