1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-05 04:10:54 +00:00

Merge pull request #3943 from zhlicen/master

#3942 fix encoded url(with slash) router match problem
This commit is contained in:
Ming Deng 2020-06-18 16:04:16 +08:00 committed by GitHub
commit 86935ada01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,7 @@ func (input *BeegoInput) URI() string {
// URL returns request url path (without query string, fragment).
func (input *BeegoInput) URL() string {
return input.Context.Request.URL.Path
return input.Context.Request.URL.EscapedPath()
}
// Site returns base site url as scheme://domain type.
@ -284,7 +284,7 @@ func (input *BeegoInput) ParamsLen() int {
func (input *BeegoInput) Param(key string) string {
for i, v := range input.pnames {
if v == key && i <= len(input.pvalues) {
return input.pvalues[i]
return url.PathEscape(input.pvalues[i])
}
}
return ""