1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

fix #2158 and more

This commit is contained in:
Gerasimos (Makis) Maropoulos
2023-07-08 02:08:18 +03:00
parent 757e7fe61b
commit 6add1ba49b
79 changed files with 551 additions and 467 deletions

View File

@@ -49,10 +49,10 @@ func TestJWT(t *testing.T) {
// Test Header.
headerValue := fmt.Sprintf("Bearer %s", token)
e.GET("/protected").WithHeader("Authorization", headerValue).Expect().
Status(iris.StatusOK).Body().Equal("bar")
Status(iris.StatusOK).Body().IsEqual("bar")
// Test URL query.
e.GET("/protected").WithQuery("token", token).Expect().
Status(iris.StatusOK).Body().Equal("bar")
Status(iris.StatusOK).Body().IsEqual("bar")
// Test unauthorized.
e.GET("/protected").Expect().Status(iris.StatusUnauthorized)
@@ -61,5 +61,5 @@ func TestJWT(t *testing.T) {
// Test expired (note checks happen based on second round).
time.Sleep(5 * time.Second)
e.GET("/protected").WithHeader("Authorization", headerValue).Expect().
Status(iris.StatusUnauthorized).Body().Equal("jwt: token expired")
Status(iris.StatusUnauthorized).Body().IsEqual("jwt: token expired")
}