-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Fix fetch plugin with old implementations #5091
Conversation
Incremental code coverage: 75.00% |
lib/net/http_fetch_plugin.js
Outdated
// eslint-disable-next-line no-restricted-syntax, no-prototype-builtins | ||
if (!Response.prototype.hasOwnProperty('body')) { |
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.
would Object.prototype.hasOwnProperty.call(Response.prototype, 'body');
allow removal of the lint exceptions?
// eslint-disable-next-line no-restricted-syntax, no-prototype-builtins | |
if (!Response.prototype.hasOwnProperty('body')) { | |
if (!Object.prototype.hasOwnProperty.call(Response.prototype , 'body')) { |
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.
You could also just make a Response
object, like we do with ReadableStream
, right?
if (window.Response) {
const response = new Response('');
if (!response.body) {
return false;
}
} else {
return false;
}
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.
Changed!
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.
@theodab can you review again?
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.
LGTM
Fixes #5088