Add Accept-Encoding header to fetch method#283
Conversation
| curl_setopt($ch, CURLOPT_HEADER, 0); | ||
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | ||
| curl_setopt($ch, CURLOPT_MAXREDIRS, 5); | ||
| curl_setopt($ch, CURLOPT_ENCODING, ''); |
There was a problem hiding this comment.
As mentioned in #208 (comment), this option was renamed so ideally, it would be replaced with CURLOPT_ACCEPT_ENCODING conditional on version (see e.g. simplepie/simplepie#960).
This is not that critical right now since the current version of php keep the old name as alias. But will cause a warning once we introduce static analysis (something I plan to do soon).
| curl_setopt($ch, CURLOPT_HEADER, 0); | ||
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | ||
| curl_setopt($ch, CURLOPT_MAXREDIRS, 5); | ||
| curl_setopt($ch, CURLOPT_ENCODING, ''); |
There was a problem hiding this comment.
Also this will break sites whose servers send encodings that curl does not support. We might receive bug reports like simplepie/simplepie#961 and then we will either have to decide that we refuse to support that, or implement retry like https://github.com/simplepie/simplepie/pull/962/commits
|
I do not think we have to be known for fetching, or supporting all those cases. So I would lean towards not supporting retries. It is always possible for someone to feed the data into It would be good to support both constants, as @jtojnar says, based on the data that PHP gives us:
Probably just based on |
Closes #208