From dcc30bcc4055e1ed0a1114f514a6bf7840fd488c Mon Sep 17 00:00:00 2001 From: Roel Standaert Date: Thu, 31 Oct 2019 18:22:19 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + test/doc/core_3_timeouts.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98cac88e..7b1fa3d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 275: * Add basic_stream::rebind_executor * Use automatically deduced return types for all async operations * Support Concepts for completion token params +* https_get example sends the Host header -------------------------------------------------------------------------------- diff --git a/test/doc/core_3_timeouts.cpp b/test/doc/core_3_timeouts.cpp index 5b7630f0..f6eb5907 100644 --- a/test/doc/core_3_timeouts.cpp +++ b/test/doc/core_3_timeouts.cpp @@ -356,7 +356,7 @@ https_get (std::string const& host, std::string const& target, error_code& ec) req.method(http::verb::get); req.target(target); req.version(11); - req.set(http::field::server, host); + req.set(http::field::host, host); req.set(http::field::user_agent, "Beast"); http::async_write(stream, req, yield[ec]); if(ec)