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 downloads with chunked responses if cURL is not installed #397

Open
wants to merge 1 commit into
base: develop
from

Conversation

@nylen
Copy link
Member

commented Mar 6, 2019

Reported here: https://forums.classicpress.net/t/update-failed-pclzip-error/849

This happens when GitHub sends a Transfer-Encoding: chunked response for an upgrade zip, which it sometimes does and sometimes doesn't, and when the PHP cURL extension is not present on the site's server.

In this case, the fsockopen transport of the underlying Requests library is used. This transport does not support chunked responses, which is a known issue: rmccue/Requests#189

This PR is a workaround which drops the HTTP protocol version back down to 1.0 in this case, from https://webmasters.stackexchange.com/a/44076/98758.

@nylen nylen added this to the v1.1.0 milestone Jun 27, 2019

@nylen

This comment has been minimized.

Copy link
Member Author

commented Jun 27, 2019

Moving to 1.1.0 milestone. Before merging, evaluate impact of this change on existing sites (how many are currently experiencing this error?)

@nylen

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2019

Slack discussion about this: https://classicpress.slack.com/archives/CCCF22HG8/p1561997683150600

Summary:

  • This is a hack
  • Should be very few users affected
  • The same issue may re-appear in v2 when we add our plugin directory which also serves downloads from GitHub

An alternative would be to require the curl transport in ClassicPress v2. This would fix this issue, while also allowing for some nice code simplifications and the ability to implement a custom CA for our plugin directory.

Labeling as "postponed until v2" so we can revisit this then.

@nylen nylen removed this from the v1.1.0 milestone Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.