trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Setting Headers for the Trunk dev server.

Open DevinLeamy opened this issue 1 year ago • 1 comments

I want to be able to serve my application (via localhost) with the following headers, to enable SharedArrayBuffer:

Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin

Currently, there doesn't seem to be a way to explicitly set headers for the dev server. It would be great if these could be set via the Trunk.toml file!

DevinLeamy avatar Jul 30 '22 02:07 DevinLeamy

Agreed that the Trunk.toml would be the best place for this.

  • The configuration cascade is as follows: env -> Trunk.toml -> CLI (in order of lowest precedence to highest precedence).
  • You can see where the config cascade starts in the code in main.
  • The CLI & ENV config are parsed together, and then that data is passed into the config/models.rs code which I linked to above. Best place to start with the config model changes would be config/models.rs.

thedodd avatar Jul 30 '22 18:07 thedodd

Is anyone working on this?

chaosprint avatar May 20 '23 19:05 chaosprint

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 22 '23 00:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 27 '23 00:09 github-actions[bot]

This probably should be planned, or, at least, the default headers should be set to allow SharedArrayBuffer use.

JohnDowson avatar Nov 23 '23 07:11 JohnDowson