-
Notifications
You must be signed in to change notification settings - Fork 352
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
fix(adapter-fetch): Correctly handle Request instance passed into fetch #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just tests are failing in CI.
const { options } = pollyRequest.requestArguments; | ||
|
||
const response = await this.native.apply(global, [ | ||
const response = await this.nativeFetch.apply(context, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Correctly handle passing a Request instance to fetch.
Motivation and Context
Resolves #255.
The approach taken to solve for this is by patching the global Request class and storing the passed in
url
andoptions
. This allows us to not only have direct access to the passed in body (e.g. no need to re-read it off the Request instance) but also not needing to hardcode which properties to take off the instance.Types of Changes
Checklist