|
|
|
@ -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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|