From: Mikko Rasa Date: Wed, 10 Aug 2011 18:05:52 +0000 (+0300) Subject: Use maputils.h X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=commitdiff_plain;h=c8df43e7794dc82d5604dfa612e464bbc5ca3cdd Use maputils.h --- diff --git a/source/message.cpp b/source/message.cpp index c9638d0..2b3e40b 100644 --- a/source/message.cpp +++ b/source/message.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include "message.h" @@ -26,11 +27,7 @@ bool Message::has_header(const string &hdr) const const string &Message::get_header(const string &hdr) const { - HeaderMap::const_iterator i = headers.find(normalize_header_name(hdr)); - if(i==headers.end()) - throw KeyError("Undefined header", hdr); - - return i->second; + return get_item(headers, normalize_header_name(hdr)); } void Message::add_content(const string &d)