summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Talbert <swt@techie.net>2022-12-30 19:41:23 -0500
committerGitHub <noreply@github.com>2022-12-30 19:41:23 -0500
commit012f3ea948c6c3de192a0629197638476f8899cc (patch)
treee576d90dde20f4ce3c72f3c5b5f6553fe89065df
parent84f775aa5879945ceab93f81e2a5ef2d956f8719 (diff)
parentb0809ba07c9958390a3dffe24d88549c26d34e53 (diff)
downloadpycurl-012f3ea948c6c3de192a0629197638476f8899cc.tar.gz
Merge pull request #784 from marcelbrouwers/ADD_CURLOPT_REQUEST_TARGET
Added option for CURLOPT_REQUEST_TARGET
-rw-r--r--src/easyopt.c3
-rw-r--r--src/module.c3
-rw-r--r--tests/option_constants_test.py6
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()