Fix content security policy for the CDN

The CDN URLs aren’t in included in the content security policy. So
browsers will refuse to load them.

This commit:
- adds each of the CDN URLs to the
- only prepend URLs in CSS files with `/static/` if we’re running
  locally (because the CDN URLs are like `static.example.com` not
  `example.com/static`)
This commit is contained in:
Chris Hill-Scott
2018-11-29 11:29:52 +00:00
parent 74459b2f2a
commit fe6610c221
4 changed files with 31 additions and 14 deletions

View File

@@ -37,7 +37,7 @@ gulp.task('copy:govuk_template:css', () => gulp.src(paths.template + 'assets/sty
}))
.on('error', plugins.sass.logError)
.pipe(plugins.cssUrlAdjuster({
prependRelative: '/static/',
prependRelative: process.env.NOTIFY_ADMIN_ENVIRONMENT == 'config.Development' ? '/static/' : '/',
}))
.pipe(gulp.dest(paths.dist + 'stylesheets/'))
);