http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Feature/allow cross origin isolated

Open TheSlowGrowth opened this issue 3 years ago • 2 comments

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?

  1. 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.

  2. options.coi and options.cors are mutually exclusive. I made the command line version fail. How could I make it fail when using httpServer.createServer(...)?

TheSlowGrowth avatar May 19 '21 14:05 TheSlowGrowth

Fixes #650

HKalbasi avatar Jan 08 '22 13:01 HKalbasi

What is the status of this?

d3lm avatar Feb 08 '22 22:02 d3lm