From 0ab03a5e2ade2f2c387d662732a02454729a400e Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 12 Feb 2011 15:52:36 +0100 Subject: [PATCH] Nu met extra puddingbroodjes! --- util/http_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/http_parser.cpp b/util/http_parser.cpp index b6bf2beb..f00cb2dd 100644 --- a/util/http_parser.cpp +++ b/util/http_parser.cpp @@ -136,6 +136,7 @@ bool HTTPReader::parse(){ if (f == std::string::npos) return false; tmpA = HTTPbuffer.substr(0, f); HTTPbuffer.erase(0, f+1); + while (tmpA.find('\r') != std::string::npos){tmpA.erase(tmpA.find('\r'));} if (!seenReq){ seenReq = true; f = tmpA.find(' '); @@ -146,7 +147,7 @@ bool HTTPReader::parse(){ if (f != std::string::npos){protocol = tmpA.substr(0, f); tmpA.erase(0, f+1);} //TODO: GET variable parsing }else{ - if (tmpA[0] == '\n'){ + if (tmpA.size() == 0){ seenHeaders = true; if (GetHeader("Content-Length") != ""){length = atoi(GetHeader("Content-Length").c_str());} }else{