Skip to content

Commit

Permalink
Dev Server: Allow crossorigin fetch of JS binaries. (#33492)
Browse files Browse the repository at this point in the history
  • Loading branch information
samouri committed Mar 26, 2021
1 parent da0a1f1 commit a430e8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build-system/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const request = require('request');
const upload = require('multer')();
const pc = process;
const autocompleteEmailData = require('./autocomplete-test-data');
const header = require('connect-header');
const runVideoTestBench = require('./app-video-testbench');
const {
getVariableRequest,
Expand Down Expand Up @@ -73,6 +74,9 @@ if (argv.coverage) {
app.use('/coverage', require('istanbul-middleware').createHandler());
}

// Built binaries should be fetchable from other origins, i.e. Storybook.
app.use(header({'Access-Control-Allow-Origin': '*'}));

// Append ?csp=1 to the URL to turn on the CSP header.
// TODO: shall we turn on CSP all the time?
app.use((req, res, next) => {
Expand Down

0 comments on commit a430e8a

Please sign in to comment.