sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
18.45k stars 1.89k forks source link

setHeaders should have a way to append instead of overwrite #12053

Open frederichoule opened 5 months ago

frederichoule commented 5 months ago

Describe the problem

When using setHeaders for setting the Link header, it overwrites the current Link header that is generated by Sveltekit.

Describe the proposed solution

setHeaders should have a way to append to the current headers instead of overwriting them.

Alternatives considered

It could be done from within hooks, but I have different Link header depending on the page, so it would be easier to manage that in +page.server.ts or +layout.server.ts.

Importance

would make my life easier

Additional Information

No response

stevengibbsonline commented 4 months ago

This would be helpful for me to quickly append Server-Timing at different parts of the app for perf monitoring when staging too. (hooks, parent loaders, etc)