Add has_content_length_impl to Fields (API Change):

* The function has_content_length_impl is added to the
  requirements of Fields.

Actions Required:

* Implement has_content_length_impl for user-defined Fields
This commit is contained in:
Vinnie Falco
2017-10-25 17:58:45 -07:00
parent feb525f829
commit 6225c5bd2f
8 changed files with 69 additions and 11 deletions
+3
View File
@@ -203,6 +203,7 @@ public:
string_view get_reason_impl() const { return {}; }
bool get_chunked_impl() const { return false; }
bool get_keep_alive_impl(unsigned) const { return true; }
bool has_content_length_impl() const { return false; }
void set_method_impl(string_view) {}
void set_target_impl(string_view s) { target = s.to_string(); }
void set_reason_impl(string_view) {}
@@ -240,6 +241,7 @@ public:
BEAST_EXPECT(req.method() == verb::get);
BEAST_EXPECT(req.target() == "/");
BEAST_EXPECT(req.body() == "Hello");
BEAST_EXPECT(! req.has_content_length());
}
{
response<string_body> res;
@@ -267,6 +269,7 @@ public:
BEAST_EXPECT(res.result() == status::bad_request);
BEAST_EXPECT(res.reason() == "Bad Request");
BEAST_EXPECT(res.body() == "Hello");
BEAST_EXPECT(! res.has_content_length());
}
}