http: do not add a referrer header with empty value

Previously an empty 'Referer:' header was added to the HTTP request when
passing `--referer ';auto'` or `--referer ''` on the command-line. This
patch makes `--referer` work like `--header 'Referer:'` and will only add
the header if it has a non-zero length value.

Reviewed-by: Jay Satiro
Closes #6610
This commit is contained in:
Viktor Szakats 2021-02-16 10:19:37 +00:00
parent cfff12a0b3
commit cdb630655d
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
1 changed files with 2 additions and 1 deletions

View File

@ -1547,7 +1547,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
}
else
config->autoreferer = FALSE;
GetStr(&config->referer, nextarg);
ptr = *nextarg ? nextarg : NULL;
GetStr(&config->referer, ptr);
}
break;
case 'E':