From: Mikko Rasa Date: Mon, 16 May 2016 15:15:29 +0000 (+0300) Subject: Fix header name normalization logic X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d5a705a45ee747f1a70b8e6f451f3501ab420103;p=libs%2Fnet.git Fix header name normalization logic If the name begins with a hyphen, the following letter shall be uppercased. --- diff --git a/source/http/message.cpp b/source/http/message.cpp index 92321e8..b86f954 100644 --- a/source/http/message.cpp +++ b/source/http/message.cpp @@ -135,13 +135,13 @@ string Message::normalize_header_name(const string &hdr) const bool upper = true; for(string::iterator i=result.begin(); i!=result.end(); ++i) { - if(upper) + if(*i=='-') + upper = true; + else if(upper) { *i = toupper(*i); upper = false; } - else if(*i=='-') - upper = true; else *i = tolower(*i); }