[Modify] Add it
This commit is contained in:
parent
2a4ea31821
commit
1c709dde7d
@ -44,6 +44,7 @@ using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using WebSocketSharp.Net;
|
||||
using WebSocketSharp.Net.WebSockets;
|
||||
@ -821,6 +822,20 @@ namespace WebSocketSharp.Server
|
||||
: address.ToString ();
|
||||
}
|
||||
|
||||
private string createFilePath (string path)
|
||||
{
|
||||
var parent = _rootPath;
|
||||
var child = path.TrimStart ('/', '\\');
|
||||
|
||||
var buff = new StringBuilder (parent, 32);
|
||||
if (parent == "/" || parent == "\\")
|
||||
buff.Append (child);
|
||||
else
|
||||
buff.AppendFormat ("/{0}", child);
|
||||
|
||||
return buff.ToString ().Replace ('\\', '/');
|
||||
}
|
||||
|
||||
private static string getHost (Uri uri)
|
||||
{
|
||||
return uri.HostNameType == UriHostNameType.IPv6 ? uri.Host : uri.DnsSafeHost;
|
||||
|
Loading…
Reference in New Issue
Block a user