mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
re-applied fix for GH# 172 which got lost in previous commit
This commit is contained in:
@@ -119,7 +119,19 @@ void HTTPRequest::setHost(const std::string& host)
|
||||
|
||||
void HTTPRequest::setHost(const std::string& host, Poco::UInt16 port)
|
||||
{
|
||||
std::string value(host);
|
||||
std::string value;
|
||||
if (host.find(':') != std::string::npos)
|
||||
{
|
||||
// IPv6 address
|
||||
value.append("[");
|
||||
value.append(host);
|
||||
value.append("]");
|
||||
}
|
||||
else
|
||||
{
|
||||
value.append(host);
|
||||
}
|
||||
|
||||
if (port != 80 && port != 443)
|
||||
{
|
||||
value.append(":");
|
||||
|
Reference in New Issue
Block a user