Add multiple content length error

fix #2468
This commit is contained in:
alandefreitas
2022-10-02 20:04:46 +08:00
committed by Klemens Morgenstern
parent b4e0f0d560
commit 5866e50438
6 changed files with 13 additions and 3 deletions
@@ -809,6 +809,11 @@ do_field(field f,
ec = error::bad_content_length;
};
auto multiple_content_length = [&ec]
{
ec = error::multiple_content_length;
};
// conflicting field
if(f_ & flagChunked)
return bad_content_length();
@@ -831,7 +836,7 @@ do_field(field f,
if (existing.has_value())
{
if (v != *existing)
return bad_content_length();
return multiple_content_length();
}
else
{