From 7fa890169172ace026ee76dcd7127cc0ed00df8d Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 12 Feb 2020 15:29:01 +0100 Subject: [PATCH] YaHTTP: Send correct Host header for IPv6 address --- ext/yahttp/yahttp/reqresp.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/yahttp/yahttp/reqresp.hpp b/ext/yahttp/yahttp/reqresp.hpp index d9e7a19728..1d310923a9 100644 --- a/ext/yahttp/yahttp/reqresp.hpp +++ b/ext/yahttp/yahttp/reqresp.hpp @@ -249,7 +249,7 @@ public: } void setup(const std::string& method_, const std::string& url_) { this->url.parse(url_); - this->headers["host"] = this->url.host; + this->headers["host"] = this->url.host.find(":") == std::string::npos ? this->url.host : "[" + this->url.host + "]"; this->method = method_; std::transform(this->method.begin(), this->method.end(), this->method.begin(), ::toupper); this->headers["user-agent"] = "YaHTTP v1.0"; -- 2.47.2