Skip to content

Commit 570318b

Browse files
committed
Support CURLOPT_HTTPAUTH
1 parent 5bded44 commit 570318b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/Curl/Handler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ private function setOption(int $opt, $value): bool
509509
case CURLOPT_PROGRESSFUNCTION:
510510
$this->progressFunction = $value;
511511
break;
512+
case CURLOPT_HTTPAUTH:
513+
if (!($value & CURLAUTH_BASIC)) {
514+
trigger_error("swoole_curl_setopt(): CURLOPT_HTTPAUTH[{$value}] is not supported", E_USER_WARNING);
515+
return false;
516+
}
517+
break;
512518
case CURLOPT_USERPWD:
513519
$this->headers['Authorization'] = 'Basic ' . base64_encode($value);
514520
break;

0 commit comments

Comments
 (0)