Allow cross origin access for RSS

Allows browser-based code to access the RSS feed without browser interrupting the connection.
This commit is contained in:
Kirdow 2021-01-30 02:09:43 +01:00 committed by GitHub
parent 4fe0ff5b1a
commit e9cd4598d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -218,4 +218,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