nghttp: Fix bug that -H does not allow single letter header name

This commit is contained in:
Tatsuhiro Tsujikawa 2014-04-26 14:53:03 +09:00
parent 078b1de12e
commit 293b717b04
1 changed files with 1 additions and 1 deletions

View File

@ -1957,7 +1957,7 @@ int main(int argc, char **argv)
char *header = optarg;
// Skip first possible ':' in the header name
char *value = strchr( optarg + 1, ':' );
if ( ! value || header + 1 == value) {
if ( ! value || (header[0] == ':' && header + 1 == value)) {
std::cerr << "-H: invalid header: " << optarg
<< std::endl;
exit(EXIT_FAILURE);