mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: get window.onerror working for CDNs
This commit is contained in:
parent
198cf851ff
commit
f34862d195
@ -11,6 +11,16 @@ module ApplicationHelper
|
|||||||
include CanonicalURL::Helpers
|
include CanonicalURL::Helpers
|
||||||
include ConfigurableUrls
|
include ConfigurableUrls
|
||||||
|
|
||||||
|
def script(*args)
|
||||||
|
# This crazy stuff is needed to get window.onerror working under a CDN
|
||||||
|
# NGINX change is also required and baked into sample config
|
||||||
|
if GlobalSetting.cdn_url
|
||||||
|
javascript_include_tag(*args, "crossorigin" => "anonymous")
|
||||||
|
else
|
||||||
|
javascript_include_tag(*args)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def discourse_csrf_tags
|
def discourse_csrf_tags
|
||||||
# anon can not have a CSRF token cause these are all pages
|
# anon can not have a CSRF token cause these are all pages
|
||||||
# that may be cached, causing a mismatch between session CSRF
|
# that may be cached, causing a mismatch between session CSRF
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
<link rel="icon" type="image/png" href="<%=SiteSetting.favicon_url%>">
|
<link rel="icon" type="image/png" href="<%=SiteSetting.favicon_url%>">
|
||||||
<link rel="apple-touch-icon" type="image/png" href="<%=SiteSetting.apple_touch_icon_url%>">
|
<link rel="apple-touch-icon" type="image/png" href="<%=SiteSetting.apple_touch_icon_url%>">
|
||||||
|
|
||||||
<%= javascript_include_tag "preload_store" %>
|
<%= script "preload_store" %>
|
||||||
<%= javascript_include_tag "locales/#{I18n.locale}" %>
|
<%= script "locales/#{I18n.locale}" %>
|
||||||
<%= javascript_include_tag "vendor" %>
|
<%= script "vendor" %>
|
||||||
<%= javascript_include_tag "application" %>
|
<%= script "application" %>
|
||||||
<%- if staff? %>
|
<%- if staff? %>
|
||||||
<%= javascript_include_tag "admin"%>
|
<%= script "admin"%>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
|
||||||
<%= render :partial => "common/special_font_face" %>
|
<%= render :partial => "common/special_font_face" %>
|
||||||
|
@ -43,7 +43,7 @@ server {
|
|||||||
set $public /var/www/discourse/public;
|
set $public /var/www/discourse/public;
|
||||||
|
|
||||||
# Prevent Internet Explorer 10 "compatibility mode", which breaks Discourse.
|
# Prevent Internet Explorer 10 "compatibility mode", which breaks Discourse.
|
||||||
# If other subdomains under your domain are supposed to use Internet Explorer Compatibility mode,
|
# If other subdomains under your domain are supposed to use Internet Explorer Compatibility mode,
|
||||||
# it may be used for this one too, unless you explicitly tell IE not to use it. Alternatively,
|
# it may be used for this one too, unless you explicitly tell IE not to use it. Alternatively,
|
||||||
# some people have reported having compatibility mode "stuck" on for some reason.
|
# some people have reported having compatibility mode "stuck" on for some reason.
|
||||||
# (This will also prevent compatibility mode in IE 8 and 9, but those browsers aren't supported anyway.
|
# (This will also prevent compatibility mode in IE 8 and 9, but those browsers aren't supported anyway.
|
||||||
@ -62,6 +62,8 @@ server {
|
|||||||
expires 1y;
|
expires 1y;
|
||||||
add_header ETag "";
|
add_header ETag "";
|
||||||
add_header Cache-Control public;
|
add_header Cache-Control public;
|
||||||
|
# enables window.onerror
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user