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

fix: Fix fetch plugin with old implementations #5091

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Mar 13, 2023

Fixes #5088

@avelad avelad added type: bug Something isn't working correctly priority: P0 Broken for everyone; no workaround; urgent labels Mar 13, 2023
@avelad avelad added this to the v4.4 milestone Mar 13, 2023
@avelad avelad added the platform: iOS Issues affecting iOS label Mar 13, 2023
@github-actions
Copy link
Contributor

Incremental code coverage: 75.00%

Comment on lines 249 to 250
// eslint-disable-next-line no-restricted-syntax, no-prototype-builtins
if (!Response.prototype.hasOwnProperty('body')) {
Copy link
Contributor

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?

Suggested change
// eslint-disable-next-line no-restricted-syntax, no-prototype-builtins
if (!Response.prototype.hasOwnProperty('body')) {
if (!Object.prototype.hasOwnProperty.call(Response.prototype , 'body')) {

Copy link
Collaborator

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;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed!

Copy link
Collaborator Author

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?

@avelad avelad requested a review from martinstark March 14, 2023 17:35
Copy link
Contributor

@martinstark martinstark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@avelad avelad merged commit 36bcc37 into shaka-project:main Mar 14, 2023
@avelad avelad deleted the old-fetch branch March 14, 2023 18:20
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
joeyparrish pushed a commit that referenced this pull request Apr 26, 2023
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: iOS Issues affecting iOS priority: P0 Broken for everyone; no workaround; urgent status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The newest shaka.net.HttpFetchPlugin is incompatible with Fetch API provided by Chrome/Edge/Firefox on iOS
3 participants