diff options
Diffstat (limited to 'workhorse/internal/upstream')
-rw-r--r-- | workhorse/internal/upstream/handlers_test.go | 6 | ||||
-rw-r--r-- | workhorse/internal/upstream/roundtripper/roundtripper_test.go | 4 | ||||
-rw-r--r-- | workhorse/internal/upstream/routes.go | 2 | ||||
-rw-r--r-- | workhorse/internal/upstream/upstream_test.go | 3 |
4 files changed, 7 insertions, 8 deletions
diff --git a/workhorse/internal/upstream/handlers_test.go b/workhorse/internal/upstream/handlers_test.go index 10c7479f5c5..03ca80ddcb9 100644 --- a/workhorse/internal/upstream/handlers_test.go +++ b/workhorse/internal/upstream/handlers_test.go @@ -4,7 +4,7 @@ import ( "bytes" "compress/gzip" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "testing" @@ -20,7 +20,7 @@ func TestGzipEncoding(t *testing.T) { fmt.Fprint(w, "test") w.Close() - body := ioutil.NopCloser(&b) + body := io.NopCloser(&b) req, err := http.NewRequest("POST", "http://address/test", body) require.NoError(t, err) @@ -38,7 +38,7 @@ func TestNoEncoding(t *testing.T) { resp := httptest.NewRecorder() var b bytes.Buffer - body := ioutil.NopCloser(&b) + body := io.NopCloser(&b) req, err := http.NewRequest("POST", "http://address/test", body) require.NoError(t, err) diff --git a/workhorse/internal/upstream/roundtripper/roundtripper_test.go b/workhorse/internal/upstream/roundtripper/roundtripper_test.go index eed71cc5bae..d3cec80d49b 100644 --- a/workhorse/internal/upstream/roundtripper/roundtripper_test.go +++ b/workhorse/internal/upstream/roundtripper/roundtripper_test.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "crypto/x509" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "net/url" @@ -86,7 +86,7 @@ func testNewBackendRoundTripper(t *testing.T, ts *httptest.Server, tlsClientConf require.NoError(t, err, "perform roundtrip") defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) require.NoError(t, err) require.Equal(t, expectedResponseBody, string(body)) diff --git a/workhorse/internal/upstream/routes.go b/workhorse/internal/upstream/routes.go index dd106053f8b..95c9b99b833 100644 --- a/workhorse/internal/upstream/routes.go +++ b/workhorse/internal/upstream/routes.go @@ -223,7 +223,7 @@ func configureRoutes(u *upstream) { mimeMultipartUploader := upload.Multipart(api, signingProxy, preparer) uploadPath := path.Join(u.DocumentRoot, "uploads/tmp") - tempfileMultipartProxy := upload.Multipart(&upload.SkipRailsAuthorizer{TempPath: uploadPath}, proxy, preparer) + tempfileMultipartProxy := upload.SkipRailsPreAuthMultipart(uploadPath, api, proxy, preparer) ciAPIProxyQueue := queueing.QueueRequests("ci_api_job_requests", tempfileMultipartProxy, u.APILimit, u.APIQueueLimit, u.APIQueueTimeout) ciAPILongPolling := builds.RegisterHandler(ciAPIProxyQueue, redis.WatchKey, u.APICILongPollingDuration) diff --git a/workhorse/internal/upstream/upstream_test.go b/workhorse/internal/upstream/upstream_test.go index 8f054f5ccef..f931c1b31b3 100644 --- a/workhorse/internal/upstream/upstream_test.go +++ b/workhorse/internal/upstream/upstream_test.go @@ -3,7 +3,6 @@ package upstream import ( "fmt" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -287,7 +286,7 @@ func runTestCases(t *testing.T, ws *httptest.Server, testCases []testCase) { require.NoError(t, err) defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) require.NoError(t, err) require.Equal(t, 200, resp.StatusCode, "response code") |