[Modify] Polish it

This commit is contained in:
sta 2017-06-29 15:43:40 +09:00
parent 48f0087fb3
commit daa6b95227

View File

@ -193,18 +193,9 @@ namespace WebSocketSharp.Server
if (path.Length == 0) if (path.Length == 0)
throw new ArgumentException ("An empty string.", "path"); throw new ArgumentException ("An empty string.", "path");
if (path.IndexOf (':') > -1)
throw new ArgumentException ("It contains ':'.", "path");
if (path.IndexOf ("..") > -1) if (path.IndexOf ("..") > -1)
throw new ArgumentException ("It contains '..'.", "path"); 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");
byte[] contents; byte[] contents;
tryReadFile (createFilePath (path), out contents); tryReadFile (createFilePath (path), out contents);