[Modify] Polish it

This commit is contained in:
sta 2021-06-23 19:46:56 +09:00
parent 8488518b4a
commit 12abf61583

View File

@ -402,14 +402,6 @@ namespace WebSocketSharp.Server
value = value.TrimSlashOrBackslashFromEnd ();
string full = null;
try {
full = Path.GetFullPath (value);
}
catch (Exception ex) {
throw new ArgumentException ("An invalid path string.", "value", ex);
}
if (value == "/")
throw new ArgumentException ("An absolute root.", "value");
@ -419,10 +411,20 @@ namespace WebSocketSharp.Server
if (value.Length == 2 && value[1] == ':')
throw new ArgumentException ("An absolute root.", "value");
string full = null;
try {
full = Path.GetFullPath (value);
}
catch (Exception ex) {
throw new ArgumentException ("An invalid path string.", "value", ex);
}
if (full == "/")
throw new ArgumentException ("An absolute root.", "value");
full = full.TrimSlashOrBackslashFromEnd ();
if (full.Length == 2 && full[1] == ':')
throw new ArgumentException ("An absolute root.", "value");