mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 04:29:23 +02:00
Merge branch 's3-proxy-fails-on-nginx' into 'master'
S3 proxy fails on nginx See merge request funkwhale/funkwhale!935
This commit is contained in:
commit
109c490639
3 changed files with 17 additions and 0 deletions
|
@ -320,6 +320,10 @@ def get_file_path(audio_file):
|
|||
)
|
||||
path = "/music" + audio_file.replace(prefix, "", 1)
|
||||
if path.startswith("http://") or path.startswith("https://"):
|
||||
protocol, remainder = path.split("://", 1)
|
||||
hostname, r_path = remainder.split("/", 1)
|
||||
r_path = urllib.parse.quote(r_path)
|
||||
path = protocol + "://" + hostname + "/" + r_path
|
||||
return (settings.PROTECT_FILES_PATH + "/media/" + path).encode("utf-8")
|
||||
# needed to serve files with % or ? chars
|
||||
path = urllib.parse.quote(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue