Fixes #231: added checks to getline calls in parse functions so that they can be used outside the Server/Client classes
This commit is contained in:
parent
5686165f35
commit
8b75c14aef
2 changed files with 30 additions and 10 deletions
|
|
@ -203,6 +203,31 @@ int main() {
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
SimpleWeb::CaseInsensitiveMultimap solution;
|
||||
std::stringstream header;
|
||||
auto parsed = SimpleWeb::HttpHeader::parse(header);
|
||||
assert(parsed == solution);
|
||||
}
|
||||
{
|
||||
SimpleWeb::CaseInsensitiveMultimap solution = {{"Content-Type", "application/json"}};
|
||||
std::stringstream header("Content-Type: application/json");
|
||||
auto parsed = SimpleWeb::HttpHeader::parse(header);
|
||||
assert(parsed == solution);
|
||||
}
|
||||
{
|
||||
SimpleWeb::CaseInsensitiveMultimap solution = {{"Content-Type", "application/json"}};
|
||||
std::stringstream header("Content-Type: application/json\r");
|
||||
auto parsed = SimpleWeb::HttpHeader::parse(header);
|
||||
assert(parsed == solution);
|
||||
}
|
||||
{
|
||||
SimpleWeb::CaseInsensitiveMultimap solution = {{"Content-Type", "application/json"}};
|
||||
std::stringstream header("Content-Type: application/json\r\n");
|
||||
auto parsed = SimpleWeb::HttpHeader::parse(header);
|
||||
assert(parsed == solution);
|
||||
}
|
||||
|
||||
{
|
||||
{
|
||||
SimpleWeb::CaseInsensitiveMultimap solution;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue