diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-30 18:20:28 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-30 18:20:28 -0600 |
| commit | d3cb17f8032d95f0f8805a0ce74fe5fc41714bb8 (patch) | |
| tree | b3a3dc15aeb344cd727e95cef28d80802f819887 /pkg | |
| parent | a372feb94ba1dfe119f2b350b77302a243ab17f2 (diff) | |
fix: strict same site mode breaks redirects
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/web/cookie/new.go | 2 | ||||
| -rw-r--r-- | pkg/web/cookie/new_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/web/cookie/new.go b/pkg/web/cookie/new.go index d762f4f..8c04dd6 100644 --- a/pkg/web/cookie/new.go +++ b/pkg/web/cookie/new.go @@ -17,7 +17,7 @@ func New(name, value string, options ...x.Option[*http.Cookie]) *http.Cookie { WithPath("/"), WithHttpOnly(true), WithSecure(true), - WithSameSite(http.SameSiteStrictMode), + WithSameSite(http.SameSiteDefaultMode), WithDomain(env.Fetch("HOST", "localhost")), ) return x.New[*http.Cookie](options...) diff --git a/pkg/web/cookie/new_test.go b/pkg/web/cookie/new_test.go index 84fac25..5c9e92c 100644 --- a/pkg/web/cookie/new_test.go +++ b/pkg/web/cookie/new_test.go @@ -14,6 +14,6 @@ func TestNew(t *testing.T) { assert.Equal(t, "sparkle.example.com", cookie.Domain) assert.True(t, cookie.HttpOnly) assert.True(t, cookie.Secure) - assert.Equal(t, http.SameSiteStrictMode, cookie.SameSite) + assert.Equal(t, http.SameSiteDefaultMode, cookie.SameSite) }) } |
