diff options
author | Marcel Brouwers <marcel@marcelbrouwers.nl> | 2022-12-30 21:58:05 +0100 |
---|---|---|
committer | Marcel Brouwers <marcel@marcelbrouwers.nl> | 2022-12-30 21:58:05 +0100 |
commit | b0809ba07c9958390a3dffe24d88549c26d34e53 (patch) | |
tree | e576d90dde20f4ce3c72f3c5b5f6553fe89065df | |
parent | 84f775aa5879945ceab93f81e2a5ef2d956f8719 (diff) | |
download | pycurl-b0809ba07c9958390a3dffe24d88549c26d34e53.tar.gz |
Added option for CURLOPT_REQUEST_TARGET
-rw-r--r-- | src/easyopt.c | 3 | ||||
-rw-r--r-- | src/module.c | 3 | ||||
-rw-r--r-- | tests/option_constants_test.py | 6 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/easyopt.c b/src/easyopt.c index faa0649..9bed04c 100644 --- a/src/easyopt.c +++ b/src/easyopt.c @@ -314,6 +314,9 @@ do_curl_setopt_string_impl(CurlObject *self, int option, PyObject *obj) case CURLOPT_PROXY_SSLKEY: case CURLOPT_PROXY_SSLKEYTYPE: #endif +#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 55, 0) + case CURLOPT_REQUEST_TARGET: +#endif #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 61, 0) case CURLOPT_TLS13_CIPHERS: case CURLOPT_PROXY_TLS13_CIPHERS: diff --git a/src/module.c b/src/module.c index d55d3eb..bb90f33 100644 --- a/src/module.c +++ b/src/module.c @@ -975,6 +975,9 @@ initpycurl(void) insint_c(d, "PROXY_SSL_VERIFYPEER", CURLOPT_PROXY_SSL_VERIFYPEER); insint_c(d, "PROXY_SSL_VERIFYHOST", CURLOPT_PROXY_SSL_VERIFYHOST); #endif +#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 55, 0) + insint_c(d, "REQUEST_TARGET", CURLOPT_REQUEST_TARGET); +#endif insint_c(d, "COPYPOSTFIELDS", CURLOPT_COPYPOSTFIELDS); insint_c(d, "SSH_HOST_PUBLIC_KEY_MD5", CURLOPT_SSH_HOST_PUBLIC_KEY_MD5); insint_c(d, "AUTOREFERER", CURLOPT_AUTOREFERER); diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py index 479c4e7..4698e3d 100644 --- a/tests/option_constants_test.py +++ b/tests/option_constants_test.py @@ -373,6 +373,12 @@ class OptionConstantsTest(unittest.TestCase): curl.setopt(curl.SSL_OPTIONS, curl.SSLOPT_NO_REVOKE) curl.close() + @util.min_libcurl(7, 55, 0) + def test_request_target_option(self): + curl = pycurl.Curl() + curl.setopt(curl.REQUEST_TARGET, '*') + curl.close() + @util.min_libcurl(7, 64, 0) def test_http09_allowed_option(self): curl = pycurl.Curl() |