mirror of
https://github.com/gin-gonic/gin.git
synced 2025-12-11 19:47:00 +08:00
Merge deb81c1d094026569067fabb5fad1eca258f6fbb into 19b877fa50cbbb9282763099fb177a1e5cc5c850
This commit is contained in:
commit
e182e61544
2
tree.go
2
tree.go
@ -832,7 +832,7 @@ walk: // Outer loop for walking the tree
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
n = n.children[0]
|
n = n.children[len(n.children)-1]
|
||||||
switch n.nType {
|
switch n.nType {
|
||||||
case param:
|
case param:
|
||||||
// Find param end (either '/' or path end)
|
// Find param end (either '/' or path end)
|
||||||
|
|||||||
@ -751,6 +751,8 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
|
|||||||
"/w/𠜎", // 4 byte
|
"/w/𠜎", // 4 byte
|
||||||
"/w/𠜏/", // 4 byte
|
"/w/𠜏/", // 4 byte
|
||||||
longPath,
|
longPath,
|
||||||
|
"/param/same/:id",
|
||||||
|
"/param/same/1",
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
@ -844,6 +846,7 @@ func TestTreeFindCaseInsensitivePath(t *testing.T) {
|
|||||||
{"/w/𠜎/", "/w/𠜎", true, true},
|
{"/w/𠜎/", "/w/𠜎", true, true},
|
||||||
{"/w/𠜏", "/w/𠜏/", true, true},
|
{"/w/𠜏", "/w/𠜏/", true, true},
|
||||||
{lOngPath, longPath, true, true},
|
{lOngPath, longPath, true, true},
|
||||||
|
{"/param/same/prefix/noexist", "", false, false},
|
||||||
}
|
}
|
||||||
// With fixTrailingSlash = true
|
// With fixTrailingSlash = true
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user