From 679c87f34be4c4aa6805511155288b13d744119d Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Mon, 21 Jul 2025 22:46:29 +0000 Subject: [PATCH] test(lib): you win this time spell check Signed-off-by: Xe Iaso --- lib/anubis_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/anubis_test.go b/lib/anubis_test.go index 61bdb7d5..056793a7 100644 --- a/lib/anubis_test.go +++ b/lib/anubis_test.go @@ -743,6 +743,7 @@ func TestStripBasePrefixFromRequest(t *testing.T) { func TestChallengeFor_ErrNotFound(t *testing.T) { pol := loadPolicies(t, "testdata/aggressive_403.yaml", 0) ckieExpiration := 10 * time.Minute + const wrongCookie = "wrong cookie" srv := spawnAnubis(t, Options{ Next: http.NewServeMux(), @@ -755,7 +756,7 @@ func TestChallengeFor_ErrNotFound(t *testing.T) { req := httptest.NewRequest("GET", "http://example.com/", nil) req.Header.Set("X-Real-IP", "127.0.0.1") req.Header.Set("User-Agent", "CHALLENGE") - req.AddCookie(&http.Cookie{Name: anubis.TestCookieName, Value: "foogoblin"}) + req.AddCookie(&http.Cookie{Name: anubis.TestCookieName, Value: wrongCookie}) w := httptest.NewRecorder() srv.maybeReverseProxyOrPage(w, req) @@ -789,7 +790,7 @@ func TestChallengeFor_ErrNotFound(t *testing.T) { found := false for _, cookie := range resp.Cookies() { if cookie.Name == anubis.TestCookieName { - if cookie.Value == "foogoblin" { + if cookie.Value == wrongCookie { t.Error("a new challenge cookie should be issued") } found = true