Skip to content

Commit f31aa9c

Browse files
committed
fix csp errors on older versions
1 parent 76c5bb1 commit f31aa9c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

middleware/csp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ module.exports = async (req, res, next) => {
5656

5757
// Exception for Algolia instantsearch in deprecated Enterprise docs (Node.js era)
5858
if (versionSatisfiesRange(requestedVersion, '<=2.19') && versionSatisfiesRange(requestedVersion, '>2.12')) {
59-
csp.directives.scriptSrc.push("'unsafe-eval'")
59+
csp.directives.scriptSrc.push("'unsafe-eval'", 'http://www.google-analytics.com')
60+
csp.directives.connectSrc.push('https://www.google-analytics.com')
61+
csp.directives.imgSrc.push('http://www.google-analytics.com')
6062
}
6163

6264
// Exception for search in deprecated Enterprise docs <=2.12 (static site era)

0 commit comments

Comments
 (0)