Remove dead code

Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
Antonio Murdaca 2015-06-20 14:28:18 +02:00
parent fbec8ef772
commit ebd569961d
2 changed files with 24 additions and 24 deletions

View File

@ -8,7 +8,6 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"net/http" "net/http"
"net/http/httputil"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
@ -200,29 +199,6 @@ func DockerHeaders(metaHeaders http.Header) []transport.RequestModifier {
return modifiers return modifiers
} }
type debugTransport struct {
http.RoundTripper
log func(...interface{})
}
func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
dump, err := httputil.DumpRequestOut(req, false)
if err != nil {
tr.log("could not dump request")
}
tr.log(string(dump))
resp, err := tr.RoundTripper.RoundTrip(req)
if err != nil {
return nil, err
}
dump, err = httputil.DumpResponse(resp, false)
if err != nil {
tr.log("could not dump response")
}
tr.log(string(dump))
return resp, err
}
func HTTPClient(transport http.RoundTripper) *http.Client { func HTTPClient(transport http.RoundTripper) *http.Client {
if transport == nil { if transport == nil {
transport = NewTransport(ConnectTimeout, true) transport = NewTransport(ConnectTimeout, true)

View File

@ -3,6 +3,7 @@ package registry
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"net/http/httputil"
"net/url" "net/url"
"strings" "strings"
"testing" "testing"
@ -911,3 +912,26 @@ func TestIsSecureIndex(t *testing.T) {
} }
} }
} }
type debugTransport struct {
http.RoundTripper
log func(...interface{})
}
func (tr debugTransport) RoundTrip(req *http.Request) (*http.Response, error) {
dump, err := httputil.DumpRequestOut(req, false)
if err != nil {
tr.log("could not dump request")
}
tr.log(string(dump))
resp, err := tr.RoundTripper.RoundTrip(req)
if err != nil {
return nil, err
}
dump, err = httputil.DumpResponse(resp, false)
if err != nil {
tr.log("could not dump response")
}
tr.log(string(dump))
return resp, err
}