Fix #947: Make media and static files serving more reliable when reverse proxy X_FORWARDED_* headers are incorrect
This commit is contained in:
parent
7c6855d915
commit
8a9f7845d4
5 changed files with 40 additions and 5 deletions
|
|
@ -3,6 +3,7 @@ import os
|
|||
import pytest
|
||||
from django.urls import reverse
|
||||
|
||||
from funkwhale_api.music import views
|
||||
|
||||
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
|
@ -47,4 +48,6 @@ def test_upload_url_is_accessible_to_authenticated_users(
|
|||
response = logged_in_api_client.get(url)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response["X-Accel-Redirect"] == "/_protected{}".format(upload.audio_file.url)
|
||||
assert response["X-Accel-Redirect"] == "/_protected{}".format(
|
||||
views.strip_absolute_media_url(upload.audio_file.url)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue