Prevent double decoding of % in url params (#17997) (#18001)

This commit is contained in:
zeripath 2021-12-16 23:03:20 +00:00 committed by GitHub
parent fc8c23edb7
commit 3a77465e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 47 additions and 7 deletions

View file

@ -669,6 +669,10 @@ func Contexter() func(next http.Handler) http.Handler {
var locale = middleware.Locale(resp, req)
var startTime = time.Now()
var link = setting.AppSubURL + strings.TrimSuffix(req.URL.EscapedPath(), "/")
chiCtx := chi.RouteContext(req.Context())
chiCtx.RoutePath = req.URL.EscapedPath()
var ctx = Context{
Resp: NewResponse(resp),
Cache: mc.GetCache(),