fix (backend-assets): use QueryEscape for the CachePath (so it includes all the parts along with port)
This commit is contained in:
parent
a98cbe883c
commit
686e85e1aa
1 changed files with 11 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue