Skip to content

Commit

Permalink
Support CURLOPT_REDIR_PROTOCOLS (#46)
Browse files Browse the repository at this point in the history
* Support CURLOPT_REDIR_PROTOCOLS

* Added CurlException for CURLOPT_REDIR_PROTOCOLS
  • Loading branch information
sy-records authored Jul 12, 2020
1 parent 2fb228b commit 27d0ee7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Curl/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,11 @@ private function setOption(int $opt, $value): bool
throw new CurlException("swoole_curl_setopt(): CURLOPT_PROTOCOLS[{$value}] is not supported");
}
break;
case CURLOPT_REDIR_PROTOCOLS:
if ($value > 3) {
throw new CurlException("swoole_curl_setopt(): CURLOPT_REDIR_PROTOCOLS[{$value}] is not supported");
}
break;
case CURLOPT_HTTP_VERSION:
if ($value != CURL_HTTP_VERSION_1_1) {
trigger_error("swoole_curl_setopt(): CURLOPT_HTTP_VERSION[{$value}] is not supported", E_USER_WARNING);
Expand Down

0 comments on commit 27d0ee7

Please sign in to comment.