From 99ed2e4722aef61bca52fc0856b310434ddf6b6a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 21 Dec 2018 22:31:47 -0800 Subject: [PATCH] http: Parse port in ipv6 addresses. --- ext/native/net/url.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/native/net/url.cpp b/ext/native/net/url.cpp index 522adc6709..a2735cf124 100644 --- a/ext/native/net/url.cpp +++ b/ext/native/net/url.cpp @@ -20,7 +20,7 @@ void Url::Split() { host_ = url_.substr(colonSlashSlash + 3, sep - colonSlashSlash - 3); resource_ = url_.substr(sep); // include the slash! - size_t portsep = host_.find(':'); + size_t portsep = host_.rfind(':'); if (portsep != host_.npos) { port_ = atoi(host_.substr(portsep + 1).c_str()); host_ = host_.substr(0, portsep);