Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

dumpling/gcs: fix http client credential problem #395

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions v4/export/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -527,18 +526,8 @@ func (conf *Config) createExternalStorage(ctx context.Context) (storage.External
if err != nil {
return nil, errors.Trace(err)
}
httpClient := http.DefaultClient
httpClient.Timeout = 30 * time.Second
maxIdleConnsPerHost := http.DefaultMaxIdleConnsPerHost
if conf.Threads > maxIdleConnsPerHost {
maxIdleConnsPerHost = conf.Threads
}
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.MaxIdleConnsPerHost = maxIdleConnsPerHost
httpClient.Transport = transport

return storage.New(ctx, b, &storage.ExternalStorageOptions{
HTTPClient: httpClient,
SkipCheckPath: true,
SendCredentials: false,
})
Expand Down