diff --git a/backend/pkg/url/assets/url.go b/backend/pkg/url/assets/url.go index 66402ab28..ea7d45ac7 100644 --- a/backend/pkg/url/assets/url.go +++ b/backend/pkg/url/assets/url.go @@ -4,6 +4,7 @@ import ( "net/url" "path/filepath" "strconv" + "strings" ) func getSessionKey(sessionID uint64) string { @@ -56,15 +57,16 @@ func GetFullCachableURL(baseURL string, relativeURL string) (string, bool) { const OPENREPLAY_QUERY_START = "OPENREPLAY_QUERY" func getCachePath(rawurl string) string { - u, _ := url.Parse(rawurl) - s := "/" + u.Scheme + "/" + u.Hostname() + u.Path - if u.RawQuery != "" { - if (s[len(s) - 1] != '/') { - s += "/" - } - s += OPENREPLAY_QUERY_START + url.PathEscape(u.RawQuery) - } - return s + return strings.ReplaceAll(url.QueryEscape(rawurl), "%", "!") // s3 keys are ok with "!" + // u, _ := url.Parse(rawurl) + // s := "/" + u.Scheme + "/" + u.Hostname() + u.Path + // if u.RawQuery != "" { + // if (s[len(s) - 1] != '/') { + // s += "/" + // } + // s += OPENREPLAY_QUERY_START + url.PathEscape(u.RawQuery) + // } + // return s } func getCachePathWithKey(sessionID uint64, rawurl string) string {