Update go dependencies (#4322)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-07-17 09:21:14 -04:00 committed by GitHub
parent 28cc3bb5e2
commit a54ab3341e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
507 changed files with 50566 additions and 40414 deletions

View file

@ -16,7 +16,6 @@ package autorest
import (
"bytes"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
@ -27,7 +26,7 @@ import (
"time"
"github.com/Azure/go-autorest/logger"
"github.com/Azure/go-autorest/tracing"
"github.com/Azure/go-autorest/version"
)
const (
@ -175,7 +174,7 @@ func NewClientWithUserAgent(ua string) Client {
PollingDuration: DefaultPollingDuration,
RetryAttempts: DefaultRetryAttempts,
RetryDuration: DefaultRetryDuration,
UserAgent: UserAgent(),
UserAgent: version.UserAgent(),
}
c.Sender = c.sender()
c.AddToUserAgent(ua)
@ -230,25 +229,9 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
// sender returns the Sender to which to send requests.
func (c Client) sender() Sender {
if c.Sender == nil {
// Use behaviour compatible with DefaultTransport, but require TLS minimum version.
var defaultTransport = http.DefaultTransport.(*http.Transport)
tracing.Transport.Base = &http.Transport{
Proxy: defaultTransport.Proxy,
DialContext: defaultTransport.DialContext,
MaxIdleConns: defaultTransport.MaxIdleConns,
IdleConnTimeout: defaultTransport.IdleConnTimeout,
TLSHandshakeTimeout: defaultTransport.TLSHandshakeTimeout,
ExpectContinueTimeout: defaultTransport.ExpectContinueTimeout,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
},
}
j, _ := cookiejar.New(nil)
return &http.Client{Jar: j, Transport: tracing.Transport}
return &http.Client{Jar: j}
}
return c.Sender
}