mirror of
https://github.com/beego/bee.git
synced 2024-11-24 23:30:55 +00:00
fix api path contain regex string bug
This commit is contained in:
parent
e90da8f77b
commit
cb47a5a5fe
@ -1100,6 +1100,12 @@ func urlReplace(src string) string {
|
|||||||
} else if p[0] == '?' && p[1] == ':' {
|
} else if p[0] == '?' && p[1] == ':' {
|
||||||
pt[i] = "{" + p[2:] + "}"
|
pt[i] = "{" + p[2:] + "}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pt[i][0] == '{' && strings.Contains(pt[i], ":") {
|
||||||
|
pt[i] = pt[i][:strings.Index(pt[i], ":")] + "}"
|
||||||
|
} else if pt[i][0] == '{' && strings.Contains(pt[i], "(") {
|
||||||
|
pt[i] = pt[i][:strings.Index(pt[i], "(")] + "}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strings.Join(pt, "/")
|
return strings.Join(pt, "/")
|
||||||
|
Loading…
Reference in New Issue
Block a user