mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 03:19:56 +02:00
Fix #196: In-place imported tracks non-ascii characters don't break reverse-proxy serving
This commit is contained in:
parent
d21a9616f9
commit
1937b81699
4 changed files with 20 additions and 2 deletions
|
@ -104,6 +104,24 @@ def test_serve_file_in_place(
|
|||
assert response[headers[proxy]] == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize('proxy,serve_path,expected', [
|
||||
('apache2', '/host/music', '/host/music/hello/worldéà.mp3'),
|
||||
('apache2', '/app/music', '/app/music/hello/worldéà.mp3'),
|
||||
('nginx', '/host/music', '/_protected/music/hello/worldéà.mp3'),
|
||||
('nginx', '/app/music', '/_protected/music/hello/worldéà.mp3'),
|
||||
])
|
||||
def test_serve_file_in_place_utf8(
|
||||
proxy, serve_path, expected, factories, api_client, settings):
|
||||
settings.PROTECT_AUDIO_FILES = False
|
||||
settings.PROTECT_FILE_PATH = '/_protected/music'
|
||||
settings.REVERSE_PROXY_TYPE = proxy
|
||||
settings.MUSIC_DIRECTORY_PATH = '/app/music'
|
||||
settings.MUSIC_DIRECTORY_SERVE_PATH = serve_path
|
||||
path = views.get_file_path('/app/music/hello/worldéà.mp3')
|
||||
|
||||
assert path == expected.encode('utf-8')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('proxy,serve_path,expected', [
|
||||
('apache2', '/host/music', '/host/media/tracks/hello/world.mp3'),
|
||||
# apache with container not supported yet
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue