diff --git a/engine/api/services/http.go b/engine/api/services/http.go index b85d847477..e36189d602 100644 --- a/engine/api/services/http.go +++ b/engine/api/services/http.go @@ -253,9 +253,7 @@ func doRequest(ctx context.Context, srv *sdk.Service, method, path string, args func doRequestFromURL(ctx context.Context, method string, callURL *url.URL, reader io.Reader, mods ...cdsclient.RequestModifier) ([]byte, http.Header, int, error) { if HTTPClient == nil { - HTTPClient = &http.Client{ - Timeout: 60 * time.Second, - } + HTTPClient = cdsclient.NewHTTPClient(60*time.Second, false) } if HTTPSigner == nil { diff --git a/engine/worker/internal/handler_download.go b/engine/worker/internal/handler_download.go index a28c0fb393..95200daae4 100644 --- a/engine/worker/internal/handler_download.go +++ b/engine/worker/internal/handler_download.go @@ -185,15 +185,15 @@ func GetArtifactFromAPI(ctx context.Context, wk *CurrentWorker, projectKey strin return newError } - regexp, errp := regexp.Compile(reqArgs.Pattern) - if errp != nil { - newError := sdk.NewError(sdk.ErrWrongRequest, fmt.Errorf("Invalid pattern %s : %s", reqArgs.Pattern, errp)) + regexp, err := regexp.Compile(reqArgs.Pattern) + if err != nil { + newError := sdk.NewError(sdk.ErrWrongRequest, fmt.Errorf("invalid pattern %s : %v", reqArgs.Pattern, err)) return newError } wg := new(sync.WaitGroup) wg.Add(len(artifacts)) - wk.SendLog(ctx, workerruntime.LevelInfo, "Downloading artifacts from into current directory") + wk.SendLog(ctx, workerruntime.LevelInfo, "Downloading artifacts into current directory") var isInError bool for i := range artifacts {