Fix custom widget loading issue #489

This commit is contained in:
Daniel Grams 2023-06-05 00:07:29 +02:00
parent f8ac9d8cec
commit fe972a9e6b
2 changed files with 6 additions and 2 deletions

View File

@ -46,7 +46,11 @@ def set_response_headers(response):
if request and request.endpoint:
if request.endpoint.startswith("api_"):
return response
if request.endpoint != "static" and request.endpoint != "widget_event_dates":
if (
request.endpoint != "static"
and request.endpoint != "widget_event_dates"
and request.endpoint != "custom_widget_type"
):
response.headers["X-Frame-Options"] = "SAMEORIGIN"
response.headers["X-Content-Type-Options"] = "nosniff"

View File

@ -233,7 +233,7 @@
xmlhttp.overrideMimeType(mimeType);
}
xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token() }}");
xmlhttp.setRequestHeader("X-CSRFToken", "{{ csrf_token() }}");
xmlhttp.send();
return xmlhttp.responseText;