mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:50:56 +00:00
Update input.go
This commit is contained in:
parent
ed73bdcfab
commit
0aa82d875a
@ -83,7 +83,7 @@ func (input *BeegoInput) URI() string {
|
|||||||
|
|
||||||
// URL returns request url path (without query string, fragment).
|
// URL returns request url path (without query string, fragment).
|
||||||
func (input *BeegoInput) URL() string {
|
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.
|
// Site returns base site url as scheme://domain type.
|
||||||
@ -275,7 +275,7 @@ func (input *BeegoInput) ParamsLen() int {
|
|||||||
func (input *BeegoInput) Param(key string) string {
|
func (input *BeegoInput) Param(key string) string {
|
||||||
for i, v := range input.pnames {
|
for i, v := range input.pnames {
|
||||||
if v == key && i <= len(input.pvalues) {
|
if v == key && i <= len(input.pvalues) {
|
||||||
return input.pvalues[i]
|
return url.PathEscape(input.pvalues[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
Reference in New Issue
Block a user