From 6718431bc4eeb9c47b68ebe8367bca253e3ae732 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 12:58:02 +0000 Subject: [PATCH] fix: improve test error handling with proper error checks Co-authored-by: Wikid82 <176516789+Wikid82@users.noreply.github.com> --- backend/internal/api/middleware/auth_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/internal/api/middleware/auth_test.go b/backend/internal/api/middleware/auth_test.go index cbabafcd..23203747 100644 --- a/backend/internal/api/middleware/auth_test.go +++ b/backend/internal/api/middleware/auth_test.go @@ -202,7 +202,8 @@ func TestAuthMiddleware_QueryParamFallback(t *testing.T) { }) // Test that query param auth still works (deprecated fallback) - req, _ := http.NewRequest("GET", "/test?token="+token, http.NoBody) + req, err := http.NewRequest("GET", "/test?token="+token, http.NoBody) + require.NoError(t, err) w := httptest.NewRecorder() r.ServeHTTP(w, req) @@ -230,7 +231,8 @@ func TestAuthMiddleware_PrefersCookieOverQueryParam(t *testing.T) { }) // Both cookie and query param provided - cookie should win - req, _ := http.NewRequest("GET", "/test?token="+queryToken, http.NoBody) + req, err := http.NewRequest("GET", "/test?token="+queryToken, http.NoBody) + require.NoError(t, err) req.AddCookie(&http.Cookie{Name: "auth_token", Value: cookieToken}) w := httptest.NewRecorder() r.ServeHTTP(w, req)