diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 469cb890..d64ce2e5 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -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;