(t *testing.T)
| 403 | } |
| 404 | |
| 405 | func TestCSRFWithoutSameSiteMode(t *testing.T) { |
| 406 | e := echo.New() |
| 407 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 408 | rec := httptest.NewRecorder() |
| 409 | c := e.NewContext(req, rec) |
| 410 | |
| 411 | csrf := CSRFWithConfig(CSRFConfig{}) |
| 412 | |
| 413 | h := csrf(func(c *echo.Context) error { |
| 414 | return c.String(http.StatusOK, "test") |
| 415 | }) |
| 416 | |
| 417 | r := h(c) |
| 418 | assert.NoError(t, r) |
| 419 | assert.NotRegexp(t, "SameSite=", rec.Header()["Set-Cookie"]) |
| 420 | } |
| 421 | |
| 422 | func TestCSRFWithSameSiteDefaultMode(t *testing.T) { |
| 423 | e := echo.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…