mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 22:34:32 +02:00
https_get example sends the Host header:
close #1751 If you try the https_get example with the Server header, servers will respond with 400 Bad Request. This example works as it should when it uses the Host header.
This commit is contained in:
committed by
Vinnie Falco
parent
bb85859e96
commit
dcc30bcc40
@@ -4,6 +4,7 @@ Version 275:
|
|||||||
* Add basic_stream::rebind_executor
|
* Add basic_stream::rebind_executor
|
||||||
* Use automatically deduced return types for all async operations
|
* Use automatically deduced return types for all async operations
|
||||||
* Support Concepts for completion token params
|
* Support Concepts for completion token params
|
||||||
|
* https_get example sends the Host header
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -356,7 +356,7 @@ https_get (std::string const& host, std::string const& target, error_code& ec)
|
|||||||
req.method(http::verb::get);
|
req.method(http::verb::get);
|
||||||
req.target(target);
|
req.target(target);
|
||||||
req.version(11);
|
req.version(11);
|
||||||
req.set(http::field::server, host);
|
req.set(http::field::host, host);
|
||||||
req.set(http::field::user_agent, "Beast");
|
req.set(http::field::user_agent, "Beast");
|
||||||
http::async_write(stream, req, yield[ec]);
|
http::async_write(stream, req, yield[ec]);
|
||||||
if(ec)
|
if(ec)
|
||||||
|
Reference in New Issue
Block a user