From e9cd4598d0481211511b9a501e410100da71fcc0 Mon Sep 17 00:00:00 2001 From: Kirdow Date: Sat, 30 Jan 2021 02:09:43 +0100 Subject: [PATCH] Allow cross origin access for RSS Allows browser-based code to access the RSS feed without browser interrupting the connection. --- nyaa/views/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nyaa/views/main.py b/nyaa/views/main.py index 2243578..4902854 100644 --- a/nyaa/views/main.py +++ b/nyaa/views/main.py @@ -218,4 +218,6 @@ def render_rss(label, query, use_elastic, magnet_links=False): response.headers['Content-Type'] = 'application/xml' # Cache for an hour response.headers['Cache-Control'] = 'max-age={}'.format(1 * 5 * 60) + # Allow cross origin access + response.headers['Access-Control-Allow-Origin'] = '*' return response