From: Michael Wallner Date: Mon, 8 Mar 2021 13:38:02 +0000 (+0100) Subject: add CURLOPT_HSTS X-Git-Tag: v4.1.0~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f6fde6989bec42e31107687fd04d44340fad4cf8;p=m6w6%2Fext-http add CURLOPT_HSTS --- diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index bd6dae5..e68a72d 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -1687,6 +1687,12 @@ static void php_http_curle_options_init(php_http_options_t *registry) opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR; } #endif +#if PHP_HTTP_CURL_VERSION(7,74,0) + php_http_option_register(registry, ZEND_STRL("hsts_ctrl"), CURLOPT_HSTS_CTRL, IS_LONG); + if ((opt = php_http_option_register(registry, ZEND_STRL("hsts"), CURLOPT_HSTS, IS_STRING))) { + opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR; + } +#endif } static zval *php_http_curle_get_option(php_http_option_t *opt, HashTable *options, void *userdata) @@ -2897,6 +2903,10 @@ PHP_MINIT_FUNCTION(http_client_curl) REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "ALTSVC_H1", CURLALTSVC_H1, CONST_CS|CONST_PERSISTENT); REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "ALTSVC_H2", CURLALTSVC_H2, CONST_CS|CONST_PERSISTENT); REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "ALTSVC_H3", CURLALTSVC_H3, CONST_CS|CONST_PERSISTENT); +#endif +#if PHP_HTTP_CURL_VERSION(7,74,0) + REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "HSTS_ENABLE", CURLHSTS_ENABLE, CONST_CS|CONST_PERSISTENT); + REGISTER_NS_LONG_CONSTANT("http\\Client\\Curl", "HSTS_READONLYFILE", CURLHSTS_READONLYFILE, CONST_CS|CONST_PERSISTENT); #endif return SUCCESS; }