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

User-provided custom headers

Open kipcode66 opened this issue 6 months ago • 0 comments

What's the problem this feature will solve?

In a project I was working on, I wished to use CORP headers in order to use SharedArrayBuffer (which is only possible if we don't allow cross origin requests through the CORP headers, which are different from the CORS headers already available in the http-server script).

Describe the solution you'd like

The solution I propose would be to add a CLI argument to provide a list of headers, potentially a string containing a semi-colon separated list of "header:value" entries.

Alternative Solutions

I used to use a python library to run an HTTPS server to test my application, but the library doesn't seem to be available on my distribution anymore. And this application seems to be more user-friendly anyway, so it would be best if we upgraded this module with the option to add custom headers.

Additional context

N/A

kipcode66 avatar Aug 10 '24 03:08 kipcode66