X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fhttp%2Fmessage.cpp;h=2ae0ff80a641e3f133f051c37fe66569e6a93944;hp=b86f95495eb267639bbc1bdf9ee58662dd198bf1;hb=62ea6954a91568c900ad8155999bea264dfa72f3;hpb=f97f21c17f24e1d426e5b5863676071a5809b185 diff --git a/source/http/message.cpp b/source/http/message.cpp index b86f954..2ae0ff8 100644 --- a/source/http/message.cpp +++ b/source/http/message.cpp @@ -120,9 +120,9 @@ string Message::str_common() const { string result; - for(HeaderMap::const_iterator i=headers.begin(); i!=headers.end(); ++i) - if(i->first[0]!='-') - result += format("%s: %s\r\n", i->first, i->second); + for(auto &kvp: headers) + if(kvp.first[0]!='-') + result += format("%s: %s\r\n", kvp.first, kvp.second); result += "\r\n"; result += content; @@ -133,17 +133,17 @@ string Message::normalize_header_name(const string &hdr) const { string result = hdr; bool upper = true; - for(string::iterator i=result.begin(); i!=result.end(); ++i) + for(char &c: result) { - if(*i=='-') + if(c=='-') upper = true; else if(upper) { - *i = toupper(*i); + c = toupper(static_cast(c)); upper = false; } else - *i = tolower(*i); + c = tolower(static_cast(c)); } return result; }