Skip to content

Commit e79c4f1

Browse files
committed
fix cpp parser
1 parent d46d300 commit e79c4f1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

parsers/cpp/request.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace hobbit{
3030

3131

3232
auto request = explode(request_line,' ');
33-
if(request.size() < 7){
33+
if(request.size() < 5){
3434
throw std::invalid_argument("Not enough parameters");
3535
//Not enough parameters
3636
}
@@ -48,11 +48,13 @@ namespace hobbit{
4848

4949
std::string marshal() const noexcept
5050
{
51-
std::string out = this->proto + " ";
52-
out += this->version + " ";
53-
out += this->command + " ";
51+
std::string out = this->proto;
52+
out += " " + this->version;
53+
out += " " + this->command;
5454
out += " " + std::to_string(this->header.size());
5555
out += " " + std::to_string(this->body.size());
56+
out += "\n";
57+
out += this->header + this->body;
5658
return out;
5759
}
5860
};

0 commit comments

Comments
 (0)