[Modify] Polish it

This commit is contained in:
sta 2017-06-28 14:32:28 +09:00
parent d64ea66209
commit cf98f324e4

View File

@ -1376,18 +1376,9 @@ namespace WebSocketSharp.Server
if (path.Length == 0)
throw new ArgumentException ("An empty string.", "path");
if (path.IndexOf (':') > -1)
throw new ArgumentException ("It contains ':'.", "path");
if (path.IndexOf ("..") > -1)
throw new ArgumentException ("It contains '..'.", "path");
if (path.IndexOf ("//") > -1)
throw new ArgumentException ("It contains '//'.", "path");
if (path.IndexOf ("\\\\") > -1)
throw new ArgumentException ("It contains '\\\\'.", "path");
path = createFilePath (path);
return File.Exists (path) ? File.ReadAllBytes (path) : null;
}