Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cross origin access for RSS #628

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nyaa/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions nyaa/views/torrents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down