Просмотр исходного кода

pkg/transport: update scheme to unix copying URL

Gyu-Ho Lee 9 лет назад
Родитель
Сommit
c8cc87c3f5
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      pkg/transport/transport.go

+ 3 - 2
pkg/transport/transport.go

@@ -64,7 +64,8 @@ func NewTransport(info TLSInfo, dialtimeoutd time.Duration) (*http.Transport, er
 }
 
 func (urt *unixTransport) RoundTrip(req *http.Request) (*http.Response, error) {
-	req2 := *req
-	req2.URL.Scheme = strings.Replace(req.URL.Scheme, "unix", "http", 1)
+	url := *req.URL
+	req.URL = &url
+	req.URL.Scheme = strings.Replace(req.URL.Scheme, "unix", "http", 1)
 	return urt.Transport.RoundTrip(req)
 }