Narrow ResolvedRequestOptions.headers type to Headers in request interceptors#3373
Draft
Narrow ResolvedRequestOptions.headers type to Headers in request interceptors#3373
ResolvedRequestOptions.headers type to Headers in request interceptors#3373Conversation
|
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
…nused imports Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
…properties Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix type of
Narrow Feb 9, 2026
ResolvedRequestOptions.headers in request interceptorsResolvedRequestOptions.headers type to Headers in request interceptors
Member
|
@copilot make sure CI checks pass |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
ResolvedRequestOptions.headerstyping in request interceptorsProblem: Request interceptors receive
options.headersthat is runtimeHeadersbut typed as union type that doesn't have.set()method. This causes TypeScript compilation errors in strict mode.Solution implemented:
ResolvedRequestOptionsinterface withheaders: Headersto all client bundles (custom-client, client-angular, client-fetch, client-ky, client-next, client-ofetch)Result: Request interceptors can now safely use all Headers methods like
.set(),.append(),.delete(),.get(), and.has()without type errors.CI Status: Examples regenerated and synced. Ready for CI validation.
Original prompt
ResolvedRequestOptions.headersshould be typed asHeadersin request interceptors #3372💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.