diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index 7299e90c..f7eee456 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -400,9 +400,9 @@ std::string &HTTP::Parser::BuildRequest(){ std::map::iterator it; if (protocol.size() < 5 || protocol[4] != '/'){protocol = "HTTP/1.0";} if (method == "GET" && vars.size() && url.find('?') == std::string::npos){ - builder = method + " " + url + allVars() + " " + protocol + "\r\n"; + builder = method + " " + Encodings::URL::encode(url, "/:=@[]") + allVars() + " " + protocol + "\r\n"; }else{ - builder = method + " " + url + " " + protocol + "\r\n"; + builder = method + " " + Encodings::URL::encode(url, "/:=@[]") + " " + protocol + "\r\n"; } for (it = headers.begin(); it != headers.end(); it++){ if ((*it).first != "" && (*it).second != ""){