http-server
http-server copied to clipboard
Feature/allow cross origin isolated
Please ensure that your pull request fulfills these requirements:
- [x] The pull request is being made against the
master
branch - [x] Tests for the changes have been added (for bug fixes / features)
What is the purpose of this pull request? (bug fix, enhancement, new feature,...)
new feature - enable cross origin isolation.
This is required to access SharedArrayBuffer
among other things. See here:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/Planned_changes
- https://developer.chrome.com/blog/enabling-shared-array-buffer/
What changes did you make?
- Add a
--coi
commandline argument - Add
options.coi
- Add a simple test - still fails, read below
Is there anything you'd like reviewers to focus on?
-
The test: It fails on both of the two required headers. I'm not sure why that happens, manual testing looks good (Testpage using
SharedArrayBuffer
in Firefox fails without--coi
but works fine with--coi
). Looking for advice. -
options.coi
andoptions.cors
are mutually exclusive. I made the command line version fail. How could I make it fail when usinghttpServer.createServer(...)
?
Fixes #650
What is the status of this?