From 2b65a165657a3b68f3971becebbbaaa92acf1b3f Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 31 Oct 2011 15:53:13 +0100 Subject: [PATCH] Fixed HTTP util parsing of variables. --- util/http_parser.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/util/http_parser.cpp b/util/http_parser.cpp index 06bc713c..2e7f7239 100644 --- a/util/http_parser.cpp +++ b/util/http_parser.cpp @@ -38,8 +38,7 @@ std::string HTTP::Parser::BuildRequest(){ for (it=headers.begin(); it != headers.end(); it++){ tmp += (*it).first + ": " + (*it).second + "\n"; } - tmp += "\n"; - tmp += body; + tmp += "\n" + body + "\n"; return tmp; } @@ -178,11 +177,8 @@ bool HTTP::Parser::parse(){ if (seenHeaders){ if (length > 0){ if (HTTPbuffer.length() >= length){ - if ((method != "HTTP/1.0") && (method != "HTTP/1.1")){ - body = HTTPbuffer.substr(0, length); - parseVars(body); //parse POST variables - } body = HTTPbuffer.substr(0, length); + parseVars(body); //parse POST variables HTTPbuffer.erase(0, length); return true; }else{