@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Http;
11
11
public class BindingAddress
12
12
{
13
13
private const string UnixPipeHostPrefix = "unix:/" ;
14
- private const string NamedPipeHostPrefix = "pipe:" ;
14
+ private const string NamedPipeHostPrefix = "pipe:/ " ;
15
15
16
16
private BindingAddress ( string host , string pathBase , int port , string scheme )
17
17
{
@@ -61,7 +61,7 @@ public BindingAddress()
61
61
/// <summary>
62
62
/// Gets a value that determines if this instance represents a named pipe.
63
63
/// <para>
64
- /// Returns <see langword="true"/> if <see cref="Host"/> starts with <c>pipe:</c> prefix.
64
+ /// Returns <see langword="true"/> if <see cref="Host"/> starts with <c>pipe:/ </c> prefix.
65
65
/// </para>
66
66
/// </summary>
67
67
public bool IsNamedPipe => Host . StartsWith ( NamedPipeHostPrefix , StringComparison . Ordinal ) ;
@@ -83,9 +83,9 @@ public string UnixPipePath
83
83
}
84
84
85
85
/// <summary>
86
- /// Gets the named pipe path if this instance represents a named pipe.
86
+ /// Gets the named pipe name if this instance represents a named pipe.
87
87
/// </summary>
88
- public string NamedPipePath
88
+ public string NamedPipeName
89
89
{
90
90
get
91
91
{
@@ -94,7 +94,7 @@ public string NamedPipePath
94
94
throw new InvalidOperationException ( "Binding address is not a named pipe." ) ;
95
95
}
96
96
97
- return GetNamedPipePath ( Host ) ;
97
+ return GetNamedPipeName ( Host ) ;
98
98
}
99
99
}
100
100
@@ -109,7 +109,7 @@ private static string GetUnixPipePath(string host)
109
109
return host . Substring ( unixPipeHostPrefixLength ) ;
110
110
}
111
111
112
- private static string GetNamedPipePath ( string host ) => host . Substring ( NamedPipeHostPrefix . Length ) ;
112
+ private static string GetNamedPipeName ( string host ) => host . Substring ( NamedPipeHostPrefix . Length ) ;
113
113
114
114
/// <inheritdoc />
115
115
public override string ToString ( )
@@ -248,11 +248,6 @@ public static BindingAddress Parse(string address)
248
248
throw new FormatException ( $ "Invalid url, unix socket path must be absolute: '{ address } '") ;
249
249
}
250
250
251
- if ( isNamedPipe && GetNamedPipePath ( host ) . Contains ( '\\ ' ) )
252
- {
253
- throw new FormatException ( $ "Invalid url, pipe name must not contain backslashes: '{ address } '") ;
254
- }
255
-
256
251
string pathBase ;
257
252
if ( address [ address . Length - 1 ] == '/' )
258
253
{
0 commit comments