From 293b717b04fa3d8b3938fa915eefdc72e6f64c4c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 26 Apr 2014 14:53:03 +0900 Subject: [PATCH] nghttp: Fix bug that -H does not allow single letter header name --- src/nghttp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index 6cf0bf50..0aa1b4c8 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -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);