From: Daniel Stenberg Date: Sat, 19 Mar 2022 21:34:19 +0000 (+0100) Subject: configure: add --enable-headers-api to enable the headers API X-Git-Tag: curl-7_83_0~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c8c723682d524ac9580b9ca3b71419163cb5660;p=thirdparty%2Fcurl.git configure: add --enable-headers-api to enable the headers API Defaults to disabled while labeled EXPERIMENTAL. Make all the headers API tests require 'headers-api' to run. --- diff --git a/configure.ac b/configure.ac index ed8018155c..b5755fb76f 100644 --- a/configure.ac +++ b/configure.ac @@ -165,6 +165,7 @@ curl_verbose_msg="enabled (--disable-verbose)" curl_rtmp_msg="no (--with-librtmp)" curl_psl_msg="no (--with-libpsl)" curl_altsvc_msg="enabled (--disable-alt-svc)" + curl_headers_msg="no (--enable-headers-api)" curl_hsts_msg="enabled (--disable-hsts)" ssl_backends= curl_h1_msg="enabled (internal)" @@ -3931,6 +3932,25 @@ AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]), AC_MSG_RESULT(yes) ) +dnl ************************************************************ +dnl switch on/off headers-api +dnl +AC_MSG_CHECKING([whether to support headers-api]) +AC_ARG_ENABLE(headers-api, +AS_HELP_STRING([--enable-headers-api],[Enable headers-api support]) +AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]), +[ case "$enableval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(USE_HEADERS_API, 1, [enable headers-api]) + curl_headers_msg="enabled"; + ;; + *) AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + dnl only check for HSTS if there's SSL present if test -n "$SSL_ENABLED"; then @@ -4345,6 +4365,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl: RTMP: ${curl_rtmp_msg} PSL: ${curl_psl_msg} Alt-svc: ${curl_altsvc_msg} + Headers API: ${curl_headers_msg} HSTS: ${curl_hsts_msg} HTTP1: ${curl_h1_msg} HTTP2: ${curl_h2_msg} diff --git a/tests/data/test1670 b/tests/data/test1670 index 51af81a9ab..6d8722f618 100644 --- a/tests/data/test1670 +++ b/tests/data/test1670 @@ -30,6 +30,9 @@ Funny-head: yesyes # # Client-side + +headers-api + http diff --git a/tests/data/test1671 b/tests/data/test1671 index ed4169955f..ea0dc3e660 100644 --- a/tests/data/test1671 +++ b/tests/data/test1671 @@ -33,6 +33,9 @@ Connection: close # # Client-side + +headers-api + http diff --git a/tests/data/test1940 b/tests/data/test1940 index 7de6d93719..682916b709 100644 --- a/tests/data/test1940 +++ b/tests/data/test1940 @@ -23,6 +23,9 @@ Location: /%TESTNUMBER0002 # Client-side + +headers-api + http diff --git a/tests/data/test1941 b/tests/data/test1941 index dcefa2818c..fe3f1de391 100644 --- a/tests/data/test1941 +++ b/tests/data/test1941 @@ -33,6 +33,7 @@ Silly-thing: yes yes proxy SSL +headers-api http diff --git a/tests/data/test1942 b/tests/data/test1942 index 4a5e1a2e8a..9079800990 100644 --- a/tests/data/test1942 +++ b/tests/data/test1942 @@ -30,6 +30,7 @@ Location: /%TESTNUMBER0002 http +headers-api http diff --git a/tests/data/test1943 b/tests/data/test1943 index 7f44b2ff5a..194ff111be 100644 --- a/tests/data/test1943 +++ b/tests/data/test1943 @@ -33,6 +33,7 @@ Server: sent-as-trailer http +headers-api http diff --git a/tests/data/test1944 b/tests/data/test1944 index 4c1f504976..3e8ed724cb 100644 --- a/tests/data/test1944 +++ b/tests/data/test1944 @@ -33,6 +33,9 @@ Set-Cookie: 2cookie=data2; # Client-side + +headers-api + http diff --git a/tests/data/test1945 b/tests/data/test1945 index f5c38e441c..86fa147adc 100644 --- a/tests/data/test1945 +++ b/tests/data/test1945 @@ -33,6 +33,7 @@ Silly-thing: yes yes proxy SSL +headers-api http diff --git a/tests/data/test1946 b/tests/data/test1946 index 4a18cf1c1c..f2f8ecc050 100644 --- a/tests/data/test1946 +++ b/tests/data/test1946 @@ -33,6 +33,9 @@ Set-Cookie: 2cookie=data2; # Client-side + +headers-api + http diff --git a/tests/runtests.pl b/tests/runtests.pl index 21fcf66752..8afdf8f4bf 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -2933,6 +2933,7 @@ sub setupfeatures { $feature{"typecheck"} = 1; $feature{"verbose-strings"} = 1; $feature{"wakeup"} = 1; + $feature{"headers-api"} = 1; } diff --git a/tests/server/disabled.c b/tests/server/disabled.c index 6f7c10f180..5ca5787e40 100644 --- a/tests/server/disabled.c +++ b/tests/server/disabled.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -69,6 +69,9 @@ static const char *disabled[]={ #endif #ifndef ENABLE_WAKEUP "wakeup", +#endif +#ifndef USE_HEADERS_API + "headers-api", #endif NULL };