Make the tool check for alt-svc support at run-time and return error
accordingly if not present when the option is used.
Reported-by: Harry Sintonen
Closes #4878
case 'b':
switch(subletter) {
case 'a': /* --alt-svc */
- GetStr(&config->altsvc, nextarg);
+ if(curlinfo->features & CURL_VERSION_ALTSVC)
+ GetStr(&config->altsvc, nextarg);
+ else
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
break;
default: /* --cookie string coming up: */
if(nextarg[0] == '@') {
if(config->disallow_username_in_url)
my_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);
-#ifdef USE_ALTSVC
- /* only if explicitly enabled in configure */
if(config->altsvc)
my_setopt_str(curl, CURLOPT_ALTSVC, config->altsvc);
-#endif
#ifdef USE_METALINK
if(!metalink && config->use_metalink) {