-
Notifications
You must be signed in to change notification settings - Fork 89
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
Replace axios #1036
Comments
global |
Verify whether nock supports fetch before proceeding |
Just wanted to note a potential gotcha if we switch over to fetch because this took me a while to figure out. The standard lib While doing the grant interaction flow (start, accept, finish), I noticed that the "finish" request did not find the koa session started by the initial "start" request. Digging a bit further, this is because the client did not send the session detail cookie on the finish request. The response from the start request contains these details in the Thus when using fetch you need to parse the cookies from the edit: TIL this is simply how most http clients work outside the browser 😑 Was getting caught up by our axios client handling cookies in our consent screen but didn't stop to think that the difference is the browser not the client. Then realized axios didn't do this either. I see there are plugins like https://github.com/3846masa/axios-cookiejar-support that add this kind of support but I wonder why its not a more common feature. Perhaps because outside the browser you cant assume non-multi-tenancy? |
If we end up working on this, I recommend using ky, since it would allow us to easily define a global http client with preset headers (with interceptors/hooks if we choose). This was done in the |
Closing - any new code changes will use native fetch (or ky, as mentioned above) |
The text was updated successfully, but these errors were encountered: