mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 15:53:41 +08:00
f0fc38418c
This commit adds a new property "discourseReferrerPolicy" to the set of supported configuration properties for the comment embed script. If provided the value will be used to set the "referrerPolicy" attribute on the iframe created to display the comments. This in turn will allow embedding pages to define a more lenient referer policy on the embed iframe for pages whose default policy is so strict it keeps the comment embed from working. Example: * Setup: * Discourse hosted at discourse.example.com * Comments embedded at example.com * Referrer-Policy at example.com set to 'same-origin' * Without this commit: * Loading the comments fails due to the referer being empty * With this commit and no adjusted configuration: * Loading the comments fails due to the referer being empty (= same behaviour as without the commit) * With this commit and DiscourseEmbed.discourseReferrerPolicy = 'no-referrer-when-downgrade' as additional configuration: * Loading the comments succeeds Note that this change is of special interest for embedding pages wanting to restrict data flows under the terms of the GDPR since it allows selectively whitelisting comment embeds while preventing referer leaking by default. |
||
---|---|---|
.. | ||
ace | ||
Chart.min.js | ||
count.js | ||
embed.js | ||
highlight.pack.js | ||
jquery.magnific-popup.min.js | ||
pikaday.js | ||
spectrum.css | ||
spectrum.js |