mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: add custom samesite options to auth cookies (#16885)
Allows controlling `samesite` cookie settings from the deployment config
This commit is contained in:
@ -53,7 +53,7 @@ func TestCSRFExemptList(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
mw := httpmw.CSRF(false)
|
||||
mw := httpmw.CSRF(codersdk.HTTPCookieConfig{})
|
||||
csrfmw := mw(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})).(*nosurf.CSRFHandler)
|
||||
|
||||
for _, c := range cases {
|
||||
@ -87,7 +87,7 @@ func TestCSRFError(t *testing.T) {
|
||||
var handler http.Handler = http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
})
|
||||
handler = httpmw.CSRF(false)(handler)
|
||||
handler = httpmw.CSRF(codersdk.HTTPCookieConfig{})(handler)
|
||||
|
||||
// Not testing the error case, just providing the example of things working
|
||||
// to base the failure tests off of.
|
||||
|
Reference in New Issue
Block a user