[Modify] Add it
This commit is contained in:
parent
aa7ffde7ac
commit
b02b6f25e0
@ -369,6 +369,35 @@ namespace WebSocketSharp.Net
|
||||
return bestMatch;
|
||||
}
|
||||
|
||||
private static HttpListener searchHttpListenerFromSpecial (
|
||||
string path, List<HttpListenerPrefix> prefixes, out HttpListenerPrefix prefix
|
||||
)
|
||||
{
|
||||
prefix = null;
|
||||
|
||||
if (prefixes == null)
|
||||
return null;
|
||||
|
||||
HttpListener bestMatch = null;
|
||||
|
||||
var bestLen = -1;
|
||||
foreach (var pref in prefixes) {
|
||||
var prefPath = pref.Path;
|
||||
|
||||
var len = prefPath.Length;
|
||||
if (len < bestLen)
|
||||
continue;
|
||||
|
||||
if (path.StartsWith (prefPath)) {
|
||||
bestLen = len;
|
||||
bestMatch = pref.Listener;
|
||||
prefix = pref;
|
||||
}
|
||||
}
|
||||
|
||||
return bestMatch;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
Loading…
Reference in New Issue
Block a user