File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class BindingAddress
1212{
1313 private const string UnixPipeHostPrefix = "unix:/" ;
1414 private const string NamedPipeHostPrefix = "pipe:/" ;
15+ private const string IPv6LoopBackPrefix = "[::1]" ;
1516
1617 private BindingAddress ( string host , string pathBase , int port , string scheme )
1718 {
@@ -163,6 +164,7 @@ public static BindingAddress Parse(string address)
163164
164165 var isUnixPipe = address . IndexOf ( UnixPipeHostPrefix , schemeDelimiterEnd , StringComparison . Ordinal ) == schemeDelimiterEnd ;
165166 var isNamedPipe = address . IndexOf ( NamedPipeHostPrefix , schemeDelimiterEnd , StringComparison . Ordinal ) == schemeDelimiterEnd ;
167+ var isIPv6LoopBack = address . IndexOf ( IPv6LoopBackPrefix , schemeDelimiterEnd , StringComparison . Ordinal ) == schemeDelimiterEnd ;
166168
167169 int pathDelimiterStart ;
168170 int pathDelimiterEnd ;
@@ -206,7 +208,7 @@ public static BindingAddress Parse(string address)
206208 if ( ! isUnixPipe && ! isNamedPipe )
207209 {
208210 var portDelimiterStart = address . LastIndexOf ( ':' , pathDelimiterStart - 1 , pathDelimiterStart - schemeDelimiterEnd ) ;
209- if ( portDelimiterStart >= 0 )
211+ if ( portDelimiterStart >= 0 && ! isIPv6LoopBack )
210212 {
211213 var portDelimiterEnd = portDelimiterStart + ":" . Length ;
212214
You can’t perform that action at this time.
0 commit comments