Allow cross origin access for RSS

Merge pull request #10 from Kirdow/master
This commit is contained in:
sb745 2025-12-22 14:39:55 +02:00 committed by GitHub
commit 42ec86b8d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -219,4 +219,6 @@ def render_rss(label, query, use_elastic, magnet_links=False):
response.headers['Content-Type'] = 'application/xml' response.headers['Content-Type'] = 'application/xml'
# Cache for an hour # Cache for an hour
response.headers['Cache-Control'] = 'max-age={}'.format(1 * 5 * 60) response.headers['Cache-Control'] = 'max-age={}'.format(1 * 5 * 60)
# Allow cross origin access
response.headers['Access-Control-Allow-Origin'] = '*'
return response return response

View file

@ -333,6 +333,8 @@ def download_torrent(torrent_id):
resp.headers['Content-Type'] = 'application/x-bittorrent' resp.headers['Content-Type'] = 'application/x-bittorrent'
resp.headers['Content-Disposition'] = disposition resp.headers['Content-Disposition'] = disposition
resp.headers['Content-Length'] = torrent_file_size resp.headers['Content-Length'] = torrent_file_size
# Allow cross origin access
resp.headers['Access-Control-Allow-Origin'] = '*'
return resp return resp