@@ -118,22 +118,22 @@ app.use((req, res, next) => {
118118// https://helmetjs.github.io/docs/csp/
119119if ( config . csp . enable ) {
120120 var cdnDirectives = {
121- scriptSrc : [ " https://cdnjs.cloudflare.com" ] ,
122- styleSrc : [ " https://cdnjs.cloudflare.com" , " https://fonts.googleapis.com" ] ,
123- fontSrc : [ " https://cdnjs.cloudflare.com" , " https://fonts.gstatic.com" ]
121+ scriptSrc : [ ' https://cdnjs.cloudflare.com' , 'https://cdn.mathjax.org' ] ,
122+ styleSrc : [ ' https://cdnjs.cloudflare.com' , ' https://fonts.googleapis.com' ] ,
123+ fontSrc : [ ' https://cdnjs.cloudflare.com' , ' https://fonts.gstatic.com' ]
124124 }
125125 var directives = { }
126126 for ( var propertyName in config . csp . directives ) {
127- if ( config . csp . directives . hasOwnProperty ( propertyName ) ) {
127+ if ( config . csp . directives . hasOwnProperty ( propertyName ) ) {
128128 var directive = config . csp . directives [ propertyName ]
129129 if ( config . usecdn && ! ! cdnDirectives [ propertyName ] ) {
130130 directive = directive . concat ( cdnDirectives [ propertyName ] )
131131 }
132- directives [ propertyName ] = directive ;
132+ directives [ propertyName ] = directive
133133 }
134134 }
135135 directives . scriptSrc . push ( function ( req , res ) { return "'nonce-" + res . locals . nonce + "'" } )
136- if ( config . csp . upgradeInsecureRequests === 'auto' ) {
136+ if ( config . csp . upgradeInsecureRequests === 'auto' ) {
137137 directives . upgradeInsecureRequests = config . usessl === 'true'
138138 } else {
139139 directives . upgradeInsecureRequests = config . csp . upgradeInsecureRequests === 'true'
@@ -142,7 +142,7 @@ if (config.csp.enable) {
142142 directives : directives
143143 } ) )
144144} else {
145- logger . info ( 'Content-Security-Policy is disabled. This may be a security risk.' ) ;
145+ logger . info ( 'Content-Security-Policy is disabled. This may be a security risk.' )
146146}
147147
148148i18n . configure ( {
0 commit comments