[Modify] Rename it
This commit is contained in:
parent
64925eaa9e
commit
2fe5697c0d
@ -905,7 +905,7 @@ namespace WebSocketSharp
|
|||||||
return BitConverter.ToUInt64 (source.ToHostOrder (sourceOrder), 0);
|
return BitConverter.ToUInt64 (source.ToHostOrder (sourceOrder), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string TrimEndSlash (this string value)
|
internal static string TrimSlashFromEnd (this string value)
|
||||||
{
|
{
|
||||||
var ret = value.TrimEnd ('/');
|
var ret = value.TrimEnd ('/');
|
||||||
return ret.Length > 0 ? ret : "/";
|
return ret.Length > 0 ? ret : "/";
|
||||||
|
@ -285,7 +285,7 @@ namespace WebSocketSharp.Server
|
|||||||
internal void Add<TBehavior> (string path, Func<TBehavior> initializer)
|
internal void Add<TBehavior> (string path, Func<TBehavior> initializer)
|
||||||
where TBehavior : WebSocketBehavior
|
where TBehavior : WebSocketBehavior
|
||||||
{
|
{
|
||||||
path = HttpUtility.UrlDecode (path).TrimEndSlash ();
|
path = HttpUtility.UrlDecode (path).TrimSlashFromEnd ();
|
||||||
|
|
||||||
lock (_sync) {
|
lock (_sync) {
|
||||||
WebSocketServiceHost host;
|
WebSocketServiceHost host;
|
||||||
@ -315,7 +315,7 @@ namespace WebSocketSharp.Server
|
|||||||
string path, out WebSocketServiceHost host
|
string path, out WebSocketServiceHost host
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
path = HttpUtility.UrlDecode (path).TrimEndSlash ();
|
path = HttpUtility.UrlDecode (path).TrimSlashFromEnd ();
|
||||||
|
|
||||||
lock (_sync)
|
lock (_sync)
|
||||||
return _hosts.TryGetValue (path, out host);
|
return _hosts.TryGetValue (path, out host);
|
||||||
@ -323,7 +323,7 @@ namespace WebSocketSharp.Server
|
|||||||
|
|
||||||
internal bool Remove (string path)
|
internal bool Remove (string path)
|
||||||
{
|
{
|
||||||
path = HttpUtility.UrlDecode (path).TrimEndSlash ();
|
path = HttpUtility.UrlDecode (path).TrimSlashFromEnd ();
|
||||||
|
|
||||||
WebSocketServiceHost host;
|
WebSocketServiceHost host;
|
||||||
lock (_sync) {
|
lock (_sync) {
|
||||||
|
Loading…
Reference in New Issue
Block a user