forked from CGM_Public/pretix_original
Widget: Fix CORS for cached JS
This commit is contained in:
@@ -173,7 +173,10 @@ def widget_js(request, lang, **kwargs):
|
|||||||
|
|
||||||
cached_js = cache.get('widget_js_data_{}'.format(lang))
|
cached_js = cache.get('widget_js_data_{}'.format(lang))
|
||||||
if cached_js and not settings.DEBUG:
|
if cached_js and not settings.DEBUG:
|
||||||
return HttpResponse(cached_js, content_type='text/javascript')
|
resp = HttpResponse(cached_js, content_type='text/javascript')
|
||||||
|
resp._csp_ignore = True
|
||||||
|
resp['Access-Control-Allow-Origin'] = '*'
|
||||||
|
return resp
|
||||||
|
|
||||||
gs = GlobalSettingsObject()
|
gs = GlobalSettingsObject()
|
||||||
fname = gs.settings.get('widget_file_{}'.format(lang))
|
fname = gs.settings.get('widget_file_{}'.format(lang))
|
||||||
|
|||||||
Reference in New Issue
Block a user