authorize: decode CheckRequest path for redirect (#2357)

This commit is contained in:
Caleb Doxsey 2021-07-13 13:17:21 -06:00 committed by GitHub
parent ca8205f0b4
commit b4b86dccb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,10 +191,11 @@ func getCheckRequestURL(req *envoy_service_auth_v3.CheckRequest) url.URL {
// envoy sends the query string as part of the path // envoy sends the query string as part of the path
path := h.GetPath() path := h.GetPath()
if idx := strings.Index(path, "?"); idx != -1 { if idx := strings.Index(path, "?"); idx != -1 {
u.Path, u.RawQuery = path[:idx], path[idx+1:] u.RawPath, u.RawQuery = path[:idx], path[idx+1:]
} else { } else {
u.Path = path u.RawPath = path
} }
u.Path, _ = url.PathUnescape(u.RawPath)
return u return u
} }