Repository: mattgodbolt/compiler-explorer (js)

Issue:
short links broken on secondary site
https://compiler-explorer.com/ short links are broken. browser:

```
Uncaught DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'http://compiler-explorer.com/z/vanRkM' cannot be created in a document with origin 'https://compiler-explorer.com' and URL 'https://compiler-explorer.com/'.
    at History.pushState (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:96:70536)
    at https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:88:110570
    at t (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:96:75392)
    at https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:96:76726
    at https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:96:76141
    at N (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:82129)
    at Object.<anonymous> (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:82331)
    at Object.success (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:75483)
    at h (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:23403)
    at Object.fireWith [as resolveWith] (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:24152)
    at n (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:62248)
    at XMLHttpRequest.<anonymous> (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:37:67251)
    at XMLHttpRequest.o (https://compiler-explorer.com/dist/bundle.5adbe814861037431ec6.js:64:13622)
sentry.io/api/102028/store/?sentry_key=8e4614f649ad4e3faf3e7e8827b935f9&sentry_version=7:1 Failed to load resource: the server responded with a status of 403 (FORBIDDEN)
```

Additionally, sentry blocked it

Pull request description:
add compiler-explorer.com to csp thingymabob
Will maybe fix #1432

Patch:
diff --git a/lib/csp.js b/lib/csp.js
index d3699babf..838657b65 100644
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -25,20 +25,27 @@
 const _ = require('underscore');
 
 const data = {
-    'default-src': ["'self'", 'https://*.godbolt.org', 'localhost:*'],
-    'style-src': ["'self'", "'unsafe-inline'", 'https://*.godbolt.org', 'localhost:*'],
+    'default-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'https://*.compiler-explorer.com'],
+    'style-src': ["'self'", "'unsafe-inline'", 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com'],
     'script-src': ["'self'", "'unsafe-inline'", 'data:', 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com',
         'https://*.twitter.com', 'https://www.google-analytics.com',
         'https://apis.google.com', 'https://ssl.google-analytics.com', 'https://sentry.io/'],
-    'img-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'data:', 'https://www.google-analytics.com/',
+    'img-src': ["'self'", 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com', 'data:', 'https://www.google-analytics.com/',
         'https://syndication.twitter.com', 'https://ssl.google-analytics.com', 'https://csi.gstatic.com'],
-    'font-src': ["'self'", 'data:', 'https://*.godbolt.org', 'localhost:*', 'https://fonts.gstatic.com',
+    'font-src': ["'self'", 'data:', 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com', 'https://fonts.gstatic.com',
         'https://themes.googleusercontent.com'],
-    'frame-src': ["'self'", 'https://*.godbolt.org', 'localhost:*', 'https://www.google-analytics.com',
+    'frame-src': ["'self'", 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com', 'https://www.google-analytics.com',
         'https://accounts.google.com/', 'https://content.googleapis.com/',
         'https://sentry.io', 'https://platform.twitter.com/', 'https://syndication.twitter.com/'],
-    'connect-src': ["'self'", '*', 'https://*.godbolt.org', 'localhost:*', 'https://api.github.com'],
-    'media-src': ["'self'", 'https://ssl.gstatic.com', 'https://*.godbolt.org', 'localhost:*']
+    'connect-src': ["'self'", '*', 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com', 'https://api.github.com'],
+    'media-src': ["'self'", 'https://ssl.gstatic.com', 'https://*.godbolt.org', 'localhost:*',
+        'https://*.compiler-explorer.com']
 };
 
 module.exports = {


Test patch:
diff --git a/test/csp-tests.js b/test/csp-tests.js
index aaa1b2a49..3511e87bd 100644
--- a/test/csp-tests.js
+++ b/test/csp-tests.js
@@ -34,6 +34,11 @@ describe('CSP', () => {
             csp.data[value].should.include.members(['https://*.godbolt.org', "'self'"])
         });
     });
+    it('Should work in the compiler-explorer domain for every field', () => {
+        Object.keys(csp.data).forEach(value => {
+            csp.data[value].should.include.members(['https://*.compiler-explorer.com', "'self'"])
+        });
+    });
     it('Should work in a localhost environment for every field', () => {
         Object.keys(csp.data).forEach(value => {
             csp.data[value].should.include.members(['localhost:*', "'self'"])