1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-03 00:56:59 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-12-28 10:41:13 -08:00
parent d174d65fd5
commit 434f4d1ae8
2 changed files with 18 additions and 3 deletions

View File

@ -69,8 +69,9 @@ func TestCSRFTokenFromQuery(t *testing.T) {
q := make(url.Values)
q.Set("csrf", "token")
e := echo.New()
req := httptest.NewRequest(echo.GET, "/?"+q.Encode(), nil)
req := httptest.NewRequest(echo.GET, "/", nil)
req.Header.Add(echo.HeaderContentType, echo.MIMEApplicationForm)
req.URL.RawQuery = q.Encode()
c := e.NewContext(req, nil)
token, err := csrfTokenFromQuery("csrf")(c)
if assert.NoError(t, err) {