forked from boostorg/beast
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:
1 parent
feb525f829
commit
6225c5bd2f
8 files changed
+69
-11
No files matched your search
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,11 @@ protected:
|
||||
bool
|
||||
get_keep_alive_impl(unsigned version) const;
|
||||
|
||||
/** Returns `true` if the Content-Length field is present.
|
||||
*/
|
||||
bool
|
||||
has_content_length_impl() const;
|
||||
|
||||
/** Set or clear the method string.
|
||||
|
||||
@note Only called for requests.
|
||||
|
||||
Reference in new issue
Block a user