mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Implement (but not enforce) CSRF for FE requests (#3786)
Future work is to enforce CSRF Co-authored-by: Presley Pizzo <presley@coder.com>
This commit is contained in:
co-authored by
Presley Pizzo
parent
9ab437d6e2
commit
9b5ee8f267
@@ -22,10 +22,7 @@ func TestWorkspaceAgent(t *testing.T) {
|
||||
setup := func(db database.Store) (*http.Request, uuid.UUID) {
|
||||
token := uuid.New()
|
||||
r := httptest.NewRequest("GET", "/", nil)
|
||||
r.AddCookie(&http.Cookie{
|
||||
Name: codersdk.SessionTokenKey,
|
||||
Value: token.String(),
|
||||
})
|
||||
r.Header.Set(codersdk.SessionCustomHeader, token.String())
|
||||
return r, token
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user