We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec2d99b commit 6cfa1f0Copy full SHA for 6cfa1f0
Net/src/HTTPRequest.cpp
@@ -119,7 +119,19 @@ void HTTPRequest::setHost(const std::string& host)
119
120
void HTTPRequest::setHost(const std::string& host, Poco::UInt16 port)
121
{
122
- std::string value(host);
+ std::string value;
123
+ if (host.find(':') != std::string::npos)
124
+ {
125
+ // IPv6 address
126
+ value.append("[");
127
+ value.append(host);
128
+ value.append("]");
129
+ }
130
+ else
131
132
133
134
+
135
if (port != 80 && port != 443)
136
137
value.append(":");
0 commit comments