We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d46d300 commit e79c4f1Copy full SHA for e79c4f1
parsers/cpp/request.h
@@ -30,7 +30,7 @@ namespace hobbit{
30
31
32
auto request = explode(request_line,' ');
33
- if(request.size() < 7){
+ if(request.size() < 5){
34
throw std::invalid_argument("Not enough parameters");
35
//Not enough parameters
36
}
@@ -48,11 +48,13 @@ namespace hobbit{
48
49
std::string marshal() const noexcept
50
{
51
- std::string out = this->proto + " ";
52
- out += this->version + " ";
53
- out += this->command + " ";
+ std::string out = this->proto;
+ out += " " + this->version;
+ out += " " + this->command;
54
out += " " + std::to_string(this->header.size());
55
out += " " + std::to_string(this->body.size());
56
+ out += "\n";
57
+ out += this->header + this->body;
58
return out;
59
60
};
0 commit comments