setHeaders should have a way to append instead of overwrite
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how setHeaders is handled for +page.server.ts and +layout.server.ts, then inspect how SvelteKit generates Link headers. Determine how an append option should preserve existing headers while allowing page-specific Link values, and verify the behavior against the relevant server-side header handling tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100