mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-31 07:08:06 +08:00
Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392)
Fix #26389 And complete an old TODO: `ctx.Params does un-escaping,..., which is incorrect.`
This commit is contained in:
@ -147,6 +147,10 @@ func (b *Base) Params(p string) string {
|
||||
return s
|
||||
}
|
||||
|
||||
func (b *Base) PathParamRaw(p string) string {
|
||||
return chi.URLParam(b.Req, strings.TrimPrefix(p, ":"))
|
||||
}
|
||||
|
||||
// ParamsInt64 returns the param on route as int64
|
||||
func (b *Base) ParamsInt64(p string) int64 {
|
||||
v, _ := strconv.ParseInt(b.Params(p), 10, 64)
|
||||
|
Reference in New Issue
Block a user