mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
Fix CSP for disqus and Google Analytics
This commit should fix existing problems with Disqus and Google Analytics enabled in the meta-yaml section of a note. Before this commit they were blocked by the strict CSP. It's still possible to disable the added directives using `addDisqus` and `addGoogleAnalytics` in the `csp` config section. They are enabled by default to prevent breaking changes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
d2cce7638a
commit
d939de17df
6 changed files with 25 additions and 9 deletions
|
@ -226,7 +226,8 @@ function showPublishNote (req, res, next) {
|
|||
lastchangeuserprofile: note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null,
|
||||
robots: meta.robots || false, // default allow robots
|
||||
GA: meta.GA,
|
||||
disqus: meta.disqus
|
||||
disqus: meta.disqus,
|
||||
cspNonce: res.locals.nonce
|
||||
}
|
||||
return renderPublish(data, res)
|
||||
}).catch(function (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue