From 0b06ef3b3be19c6c682211f082d148de71233990 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Mon, 30 Mar 2020 09:57:43 +0200 Subject: [PATCH] Fix #1065: irrelevant redirection to HTML repr of a library --- api/funkwhale_api/federation/utils.py | 1 + api/tests/federation/test_views.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/api/funkwhale_api/federation/utils.py b/api/funkwhale_api/federation/utils.py index b4f63e680..b1f3fdb06 100644 --- a/api/funkwhale_api/federation/utils.py +++ b/api/funkwhale_api/federation/utils.py @@ -215,6 +215,7 @@ def should_redirect_ap_to_html(accept_header, default=True): "text/html", ] no_redirect_headers = [ + "*/*", # XXX backward compat with older Funkwhale instances that don't send the Accept header "application/json", "application/activity+json", "application/ld+json", diff --git a/api/tests/federation/test_views.py b/api/tests/federation/test_views.py index 05604f7ef..1f67f6f27 100644 --- a/api/tests/federation/test_views.py +++ b/api/tests/federation/test_views.py @@ -371,6 +371,11 @@ def test_music_upload_detail_private_approved_follow( ("text/html,application/xhtml+xml", True, True), ("text/html,application/json", True, True), ("", True, False), + ( + "*/*", + True, + False, + ), # XXX: compat with older versions of Funkwhale that miss the Accept header (None, True, False), ("application/json", True, False), ("application/activity+json", True, False),