diff --git a/nyaa/views/main.py b/nyaa/views/main.py index bbbdb8b..fdb343e 100644 --- a/nyaa/views/main.py +++ b/nyaa/views/main.py @@ -219,4 +219,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 diff --git a/nyaa/views/torrents.py b/nyaa/views/torrents.py index 85a791a..44c5acd 100644 --- a/nyaa/views/torrents.py +++ b/nyaa/views/torrents.py @@ -333,6 +333,8 @@ def download_torrent(torrent_id): resp.headers['Content-Type'] = 'application/x-bittorrent' resp.headers['Content-Disposition'] = disposition resp.headers['Content-Length'] = torrent_file_size + # Allow cross origin access + resp.headers['Access-Control-Allow-Origin'] = '*' return resp