(t *testing.T)
| 420 | } |
| 421 | |
| 422 | func TestCSRFWithSameSiteDefaultMode(t *testing.T) { |
| 423 | e := echo.New() |
| 424 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 425 | rec := httptest.NewRecorder() |
| 426 | c := e.NewContext(req, rec) |
| 427 | |
| 428 | csrf := CSRFWithConfig(CSRFConfig{ |
| 429 | CookieSameSite: http.SameSiteDefaultMode, |
| 430 | }) |
| 431 | |
| 432 | h := csrf(func(c *echo.Context) error { |
| 433 | return c.String(http.StatusOK, "test") |
| 434 | }) |
| 435 | |
| 436 | r := h(c) |
| 437 | assert.NoError(t, r) |
| 438 | assert.NotRegexp(t, "SameSite=", rec.Header()["Set-Cookie"]) |
| 439 | } |
| 440 | |
| 441 | func TestCSRFWithSameSiteModeNone(t *testing.T) { |
| 442 | e := echo.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…