Skip to content

Commit

Permalink
Merge pull request #16970 from darthtrevino/feature/shared_array_buff…
Browse files Browse the repository at this point in the history
…er_headers

Add headers to enable SharedArrayBuffer in stories
  • Loading branch information
ndelangen committed Mar 22, 2022
2 parents 7450c40 + cc835b0 commit f808842
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core-server/src/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export async function storybookDevServer(options: Options) {
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
// These headers are required to enable SharedArrayBuffer
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
res.header('Cross-Origin-Opener-Policy', 'same-origin');
res.header('Cross-Origin-Embedder-Policy', 'require-corp');
next();
});

Expand Down

0 comments on commit f808842

Please sign in to comment.