Skip to content
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

make setting headers in request object consistent #205

Open
rishabhpoddar opened this issue Mar 15, 2023 · 0 comments
Open

make setting headers in request object consistent #205

rishabhpoddar opened this issue Mar 15, 2023 · 0 comments
Assignees

Comments

@rishabhpoddar
Copy link
Member

rishabhpoddar commented Mar 15, 2023

Somewhere we use headers.set, whereas somewhere else we use headers = {key1: "..", }.

This causes an issue in the pre API hook wherein if the user wants to modify the headers, in order to copy over the existing headers, they have to somewhere use headers.entries() (in case for refresh API) and do a foreach and somewhere else they have to do {...context.requestInit.headers} (in case for signout API).

We should be consistent in how we set headers to the request object.

Im not sure if this also affects the user's request interceptor since there too we use header.set to add rid: anti-csrf, so what if the user has added headers to the request using just a method like header['.."] = ".."?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants