From: Michael Wallner Date: Fri, 5 Mar 2021 15:54:40 +0000 (+0100) Subject: add CURLAUTH_BEARER and CURLOPT_XOAUTH2_BEARER X-Git-Tag: v4.1.0~17 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3f4207e32a04239194edbf39da40f5dcc37634f0;p=m6w6%2Fext-http add CURLAUTH_BEARER and CURLOPT_XOAUTH2_BEARER --- diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index b4f2d04..e1683ea 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -1316,6 +1316,11 @@ static void php_http_curle_options_init(php_http_options_t *registry) opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN; } #endif +#if PHP_HTTP_CURL_VERSION(7,61,0) + if ((opt = php_http_option_register(registry, ZEND_STRL("xoauth2_bearer"), CURLOPT_XOAUTH2_BEARER, IS_STRING))) { + opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN; + } +#endif /* redirects */ if ((opt = php_http_option_register(registry, ZEND_STRL("redirect"), CURLOPT_FOLLOWLOCATION, IS_LONG))) { @@ -2810,6 +2815,9 @@ PHP_MINIT_FUNCTION(http_client_curl) REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "AUTH_GSSNEG", CURLAUTH_GSSNEGOTIATE, CONST_CS|CONST_PERSISTENT); #if PHP_HTTP_CURL_VERSION(7,38,0) REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "AUTH_SPNEGO", CURLAUTH_NEGOTIATE, CONST_CS|CONST_PERSISTENT); +#endif +#if PHP_HTTP_CURL_VERSION(7,61,0) + REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "AUTH_BEARER", CURLAUTH_BEARER, CONST_CS|CONST_PERSISTENT); #endif REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "AUTH_ANY", CURLAUTH_ANY, CONST_CS|CONST_PERSISTENT);