mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fnlb was moved to its own repo: fnproject/lb (#702)
* Fnlb was moved to its own repo: fnproject/lb * Clean up fnlb leftovers * Newer deps
This commit is contained in:
committed by
Reed Allman
parent
4ffa3d5005
commit
d3be603e54
38
vendor/github.com/gin-gonic/gin/routes_test.go
generated
vendored
38
vendor/github.com/gin-gonic/gin/routes_test.go
generated
vendored
@@ -356,25 +356,25 @@ func TestRouterNotFound(t *testing.T) {
|
||||
router.GET("/", func(c *Context) {})
|
||||
|
||||
testRoutes := []struct {
|
||||
route string
|
||||
code int
|
||||
location string
|
||||
route string
|
||||
code int
|
||||
header string
|
||||
}{
|
||||
{"/path/", 301, "/path"}, // TSR -/
|
||||
{"/dir", 301, "/dir/"}, // TSR +/
|
||||
{"", 301, "/"}, // TSR +/
|
||||
{"/PATH", 301, "/path"}, // Fixed Case
|
||||
{"/DIR/", 301, "/dir/"}, // Fixed Case
|
||||
{"/PATH/", 301, "/path"}, // Fixed Case -/
|
||||
{"/DIR", 301, "/dir/"}, // Fixed Case +/
|
||||
{"/../path", 301, "/path"}, // CleanPath
|
||||
{"/nope", 404, ""}, // NotFound
|
||||
{"/path/", 301, "map[Location:[/path]]"}, // TSR -/
|
||||
{"/dir", 301, "map[Location:[/dir/]]"}, // TSR +/
|
||||
{"", 301, "map[Location:[/]]"}, // TSR +/
|
||||
{"/PATH", 301, "map[Location:[/path]]"}, // Fixed Case
|
||||
{"/DIR/", 301, "map[Location:[/dir/]]"}, // Fixed Case
|
||||
{"/PATH/", 301, "map[Location:[/path]]"}, // Fixed Case -/
|
||||
{"/DIR", 301, "map[Location:[/dir/]]"}, // Fixed Case +/
|
||||
{"/../path", 301, "map[Location:[/path]]"}, // CleanPath
|
||||
{"/nope", 404, ""}, // NotFound
|
||||
}
|
||||
for _, tr := range testRoutes {
|
||||
w := performRequest(router, "GET", tr.route)
|
||||
assert.Equal(t, w.Code, tr.code)
|
||||
if w.Code != 404 {
|
||||
assert.Equal(t, fmt.Sprint(w.Header().Get("Location")), tr.location)
|
||||
assert.Equal(t, fmt.Sprint(w.Header()), tr.header)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,15 +439,3 @@ func TestRouteRawPathNoUnescape(t *testing.T) {
|
||||
w := performRequest(route, "POST", "/project/Some%2FOther%2FProject/build/333")
|
||||
assert.Equal(t, w.Code, 200)
|
||||
}
|
||||
|
||||
func TestRouteServeErrorWithWriteHeader(t *testing.T) {
|
||||
route := New()
|
||||
route.Use(func(c *Context) {
|
||||
c.Status(421)
|
||||
c.Next()
|
||||
})
|
||||
|
||||
w := performRequest(route, "GET", "/NotFound")
|
||||
assert.Equal(t, 421, w.Code)
|
||||
assert.Equal(t, 0, w.Body.Len())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user