mirror of https://github.com/golang/go.git
net/http/httptest: remove unnecessary creation of http.Transport
In (*Server).StartTLS, it's unnecessary to create an http.Client
with a Transport, because a new one will be created with the
TLSClientConfig later.
Change-Id: I086e28717e9739787529006c3f0296c8224cd790
GitHub-Last-Rev: 33724596bd
GitHub-Pull-Request: golang/go#60124
Reviewed-on: https://go-review.googlesource.com/c/go/+/494355
Run-TryBot: t hepudds <thepudds1460@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
This commit is contained in:
parent
be26ae18ca
commit
f5ec2e46d9
|
|
@ -144,7 +144,7 @@ func (s *Server) StartTLS() {
|
||||||
panic("Server already started")
|
panic("Server already started")
|
||||||
}
|
}
|
||||||
if s.client == nil {
|
if s.client == nil {
|
||||||
s.client = &http.Client{Transport: &http.Transport{}}
|
s.client = &http.Client{}
|
||||||
}
|
}
|
||||||
cert, err := tls.X509KeyPair(testcert.LocalhostCert, testcert.LocalhostKey)
|
cert, err := tls.X509KeyPair(testcert.LocalhostCert, testcert.LocalhostKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue