-
-
Notifications
You must be signed in to change notification settings - Fork 307
Narrow ResolvedRequestOptions.headers type to Headers in request interceptors
#3373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
|
|
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>
ResolvedRequestOptions.headers in request interceptorsResolvedRequestOptions.headers type to Headers in request interceptors
|
@copilot make sure CI checks pass |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
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.