Added redirect method
This commit is contained in:
@ -60,6 +60,10 @@ func TestRouter(t *testing.T) {
|
||||
return ctx.Request().Context().Err()
|
||||
})
|
||||
|
||||
s.Get("/redirect", func(ctx server.Context) error {
|
||||
return ctx.Redirect(http.StatusTemporaryRedirect, "/")
|
||||
})
|
||||
|
||||
s.Get("/request/data", func(ctx server.Context) error {
|
||||
request := ctx.Request()
|
||||
method := request.Method()
|
||||
@ -124,6 +128,7 @@ func TestRouter(t *testing.T) {
|
||||
{Method: "GET", URL: "/request/header", Body: "", Status: http.StatusOK, Response: ""},
|
||||
{Method: "GET", URL: "/response/header", Body: "", Status: http.StatusOK, Response: "text/plain"},
|
||||
{Method: "GET", URL: "/reader", Body: "", Status: http.StatusOK, Response: "Hello"},
|
||||
{Method: "GET", URL: "/redirect", Body: "", Status: http.StatusTemporaryRedirect, Response: ""},
|
||||
{Method: "GET", URL: "/string", Body: "", Status: http.StatusOK, Response: "Hello"},
|
||||
{Method: "GET", URL: "/scheme", Body: "", Status: http.StatusOK, Response: "http"},
|
||||
{Method: "GET", URL: "/write", Body: "", Status: http.StatusOK, Response: "Hello"},
|
||||
|
Reference in New Issue
Block a user