diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-05 00:25:24 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-11-05 00:25:24 +0900 |
| commit | 79876af88f0faa7e3b60bef02a3f21f7466c76ef (patch) | |
| tree | efff535c23bc9a4c24563ca628257f74c6c734b1 /src/HttpServer.cc | |
| parent | 601ec0f44adcbf97e7566b64fa9677f3b117ae6e (diff) | |
Removed util::endsWith(a, b). Added util::iendsWith()
Diffstat (limited to 'src/HttpServer.cc')
| -rw-r--r-- | src/HttpServer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 919ea228..cef02a80 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -185,7 +185,9 @@ void HttpServer::feedResponse(const std::string& status, } if(!headers.empty()) { header += headers; - if(!util::endsWith(headers, "\r\n")) { + if(headers.size() < 2 || + (headers[headers.size()-2] != '\r' && + headers[headers.size()-1] != '\n')) { header += "\r\n"; } } |
