Open kymtwyf opened 1 year ago
to make the plural function:
function makePluralFunc(pluralStr) { /* eslint-disable no-new-func */ var fn = fnCache[pluralStr]; if (!fn) { fn = new Function('n', 'args', pluralFnBody(pluralStr)); fnCache[pluralStr] = fn; } return fn; }
the above code uses the new Function which validates againt Content Security Policy of browsers. How can I mitigate this usage ?
new Function
Any updates on this? Facing the same issue with CSP violation in our repo, and struggling to come up with an idea how to solve it.
Thnx
to make the plural function:
the above code uses the
new Function
which validates againt Content Security Policy of browsers. How can I mitigate this usage ?