diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index a16c2e9f..d7efe6a6 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -313,6 +313,20 @@ std::string HTTP::Parser::GetVar(std::string i) { return vars[i]; } +std::string HTTP::Parser::allVars(){ + std::string ret; + if (!vars.size()){return ret;} + for (std::map::iterator it = vars.begin(); it != vars.end(); ++it){ + if (ret.size() > 1){ + ret += "&"; + }else{ + ret += "?"; + } + ret += it->first + "=" + Encodings::URL::encode(it->second); + } + return ret; +} + /// Sets header i to string value v. void HTTP::Parser::SetHeader(std::string i, std::string v) { Trim(i); diff --git a/lib/http_parser.h b/lib/http_parser.h index fbfe10a3..4e304038 100644 --- a/lib/http_parser.h +++ b/lib/http_parser.h @@ -19,6 +19,7 @@ namespace HTTP { std::string GetHeader(std::string i); std::string GetVar(std::string i); std::string getUrl(); + std::string allVars(); void SetHeader(std::string i, std::string v); void SetHeader(std::string i, long long v); void setCORSHeaders(); diff --git a/src/output/output_http.cpp b/src/output/output_http.cpp index 8f984468..5161c20f 100644 --- a/src/output/output_http.cpp +++ b/src/output/output_http.cpp @@ -160,7 +160,9 @@ namespace Mist { if (!myConn.Received().size()){ if (myConn.peek() && H.Read(myConn)){ std::string handler = getHandler(); - reqUrl = H.url;/*LTS*/ + /*LTS-START*/ + reqUrl = H.url + H.allVars(); + /*LTS-END*/ DEBUG_MSG(DLVL_MEDIUM, "Received request: %s => %s (%s)", H.getUrl().c_str(), handler.c_str(), H.GetVar("stream").c_str()); if (!handler.size()){ H.Clean();