Skip to content

Commit

Permalink
fix: force HTTP 1.1 in curl requests (RSS-Bridge#2949)
Browse files Browse the repository at this point in the history
Since curl 7.62.0 the default option is: CURL_HTTP_VERSION_2TLS

Before that the default used to be: CURL_HTTP_VERSION_1_1

Fix RSS-Bridge#2947
  • Loading branch information
dvikan authored Aug 5, 2022
1 parent 205f0a7 commit b042412
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ function _http_request(string $url, array $config = []): array
curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
// Force HTTP 1.1 because newer versions of libcurl defaults to HTTP/2
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
if ($config['proxy']) {
curl_setopt($ch, CURLOPT_PROXY, $config['proxy']);
}
Expand Down

0 comments on commit b042412

Please sign in to comment.