From 146e6298959a994ade9ded7ccde16df2d6389ba4 Mon Sep 17 00:00:00 2001 From: Cas <6506529+ThaUnknown@users.noreply.github.com> Date: Tue, 12 Oct 2021 21:04:11 +0200 Subject: [PATCH] Allow cross origin access for .torrent files --- nyaa/views/torrents.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nyaa/views/torrents.py b/nyaa/views/torrents.py index 743c791..48a8ef5 100644 --- a/nyaa/views/torrents.py +++ b/nyaa/views/torrents.py @@ -332,6 +332,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