[Modify] Polish it
This commit is contained in:
parent
d64ea66209
commit
cf98f324e4
@ -1376,18 +1376,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");
|
|
||||||
|
|
||||||
path = createFilePath (path);
|
path = createFilePath (path);
|
||||||
return File.Exists (path) ? File.ReadAllBytes (path) : null;
|
return File.Exists (path) ? File.ReadAllBytes (path) : null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user