diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/handlers/handlers_test.go | 5 | ||||
-rw-r--r-- | internal/httprange/resource.go | 1 | ||||
-rw-r--r-- | internal/httptransport/transport_test.go | 2 |
3 files changed, 0 insertions, 8 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index a5044d09..d71e9b91 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -74,7 +74,6 @@ func TestNotFoundWithTokenIsNotHandled(t *testing.T) { reqURL, _ := url.Parse("/") r := &http.Request{URL: reqURL} response := &http.Response{StatusCode: http.StatusNotFound} - // nolint:bodyclose // TODO investigate https://gitlab.com/gitlab-org/gitlab-pages/-/issues/606 handled := handlers.checkIfLoginRequiredOrInvalidToken(w, r, "token")(response) require.False(t, handled) @@ -116,7 +115,6 @@ func TestForbiddenWithTokenIsNotHandled(t *testing.T) { w := httptest.NewRecorder() r := httptest.NewRequest(http.MethodGet, "/", nil) response := &http.Response{StatusCode: tc.StatusCode} - // nolint:bodyclose // TODO investigate https://gitlab.com/gitlab-org/gitlab-pages/-/issues/606 handled := handlers.checkIfLoginRequiredOrInvalidToken(w, r, tc.Token)(response) require.Equal(t, tc.Handled, handled) @@ -135,7 +133,6 @@ func TestNotFoundWithoutTokenIsNotHandledWhenNotAuthSupport(t *testing.T) { w := httptest.NewRecorder() r := httptest.NewRequest(http.MethodGet, "/", nil) response := &http.Response{StatusCode: http.StatusNotFound} - // nolint:bodyclose // TODO investigate https://gitlab.com/gitlab-org/gitlab-pages/-/issues/606 handled := handlers.checkIfLoginRequiredOrInvalidToken(w, r, "")(response) require.False(t, handled) @@ -152,7 +149,6 @@ func TestNotFoundWithoutTokenIsHandled(t *testing.T) { w := httptest.NewRecorder() r := httptest.NewRequest(http.MethodGet, "/", nil) response := &http.Response{StatusCode: http.StatusNotFound} - // nolint:bodyclose // TODO investigate https://gitlab.com/gitlab-org/gitlab-pages/-/issues/606 handled := handlers.checkIfLoginRequiredOrInvalidToken(w, r, "")(response) require.True(t, handled) @@ -169,7 +165,6 @@ func TestInvalidTokenResponseIsHandled(t *testing.T) { w := httptest.NewRecorder() r := httptest.NewRequest(http.MethodGet, "/", nil) response := &http.Response{StatusCode: http.StatusUnauthorized} - // nolint:bodyclose // TODO investigate https://gitlab.com/gitlab-org/gitlab-pages/-/issues/606 handled := handlers.checkIfLoginRequiredOrInvalidToken(w, r, "token")(response) require.True(t, handled) diff --git a/internal/httprange/resource.go b/internal/httprange/resource.go index 1da1af95..f90e6f5f 100644 --- a/internal/httprange/resource.go +++ b/internal/httprange/resource.go @@ -78,7 +78,6 @@ func NewResource(ctx context.Context, url string, httpClient *http.Client) (*Res // we fetch a single byte and ensure that range requests is additionally supported req.Header.Set("Range", fmt.Sprintf("bytes=%d-%d", 0, 0)) - // nolint: bodyclose // body will be closed by discardAndClose res, err := httpClient.Do(req) if err != nil { diff --git a/internal/httptransport/transport_test.go b/internal/httptransport/transport_test.go index 7fce1b15..feaf63b6 100644 --- a/internal/httptransport/transport_test.go +++ b/internal/httptransport/transport_test.go @@ -58,7 +58,6 @@ func Test_withRoundTripper(t *testing.T) { mtr := &meteredRoundTripper{next: next, durations: histVec, counter: counterVec, ttfbTimeout: DefaultTTFBTimeout} r := httptest.NewRequest("GET", "/", nil) - // nolint:bodyclose // res.Body is nil res, err := mtr.RoundTrip(r) if tt.err != nil { counterCount := testutil.ToFloat64(counterVec.WithLabelValues("error")) @@ -91,7 +90,6 @@ func TestRoundTripTTFBTimeout(t *testing.T) { req, err := http.NewRequest("GET", "https://gitlab.com", nil) require.NoError(t, err) - // nolint:bodyclose // res is nil res, err := mtr.RoundTrip(req) require.Nil(t, res) require.True(t, errors.Is(err, context.Canceled), "context must have been canceled after ttfb timeout") |