From: Pieter Lexis Date: Wed, 12 Feb 2020 14:29:01 +0000 (+0100) Subject: YaHTTP: Send correct Host header for IPv6 address X-Git-Tag: auth-4.3.0-beta2~13^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8815%2Fhead;p=thirdparty%2Fpdns.git YaHTTP: Send correct Host header for IPv6 address --- 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";