mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
Deprecate string_param
(API Change):
API Changes: `string_param`, which was previously the argument type when setting field values has been replaced by `string_view`. Because of this, it is no longer possible to set message field values directly as integrals. Users are required to convert numeric arguments to a string type prior to calling `fields::set` et. al. Beast provides the non-allocating `to_static_string()` function for this purpose. To set Content-Length field manually, call `message::content_length`. fixes #1956
This commit is contained in:
@@ -316,7 +316,7 @@ void do_server_head(
|
||||
// set of headers that would be sent for a GET request,
|
||||
// including the Content-Length, except for the body.
|
||||
res.result(status::ok);
|
||||
res.set(field::content_length, payload.size());
|
||||
res.content_length(payload.size());
|
||||
|
||||
// For GET requests, we include the body
|
||||
if(req.method() == verb::get)
|
||||
|
Reference in New Issue
Block a user