nghttp: Fix bug that -H does not allow single letter header name
This commit is contained in:
parent
078b1de12e
commit
293b717b04
|
@ -1957,7 +1957,7 @@ int main(int argc, char **argv)
|
||||||
char *header = optarg;
|
char *header = optarg;
|
||||||
// Skip first possible ':' in the header name
|
// Skip first possible ':' in the header name
|
||||||
char *value = strchr( optarg + 1, ':' );
|
char *value = strchr( optarg + 1, ':' );
|
||||||
if ( ! value || header + 1 == value) {
|
if ( ! value || (header[0] == ':' && header + 1 == value)) {
|
||||||
std::cerr << "-H: invalid header: " << optarg
|
std::cerr << "-H: invalid header: " << optarg
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
Loading…
Reference in New Issue