mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 10:19:55 +02:00
Fix #924: in-place imported files not playing under nginx when filename contains ? or %
This commit is contained in:
parent
7b0f631b32
commit
f0bea39d6a
3 changed files with 27 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
import datetime
|
||||
import logging
|
||||
import urllib
|
||||
import urllib.parse
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import transaction
|
||||
|
@ -321,6 +321,8 @@ def get_file_path(audio_file):
|
|||
path = "/music" + audio_file.replace(prefix, "", 1)
|
||||
if path.startswith("http://") or path.startswith("https://"):
|
||||
return (settings.PROTECT_FILES_PATH + "/media/" + path).encode("utf-8")
|
||||
# needed to serve files with % or ? chars
|
||||
path = urllib.parse.quote(path)
|
||||
return (settings.PROTECT_FILES_PATH + path).encode("utf-8")
|
||||
if t == "apache2":
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue