diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs
index 65122956..f2f66742 100644
--- a/websocket-sharp/Server/HttpServer.cs
+++ b/websocket-sharp/Server/HttpServer.cs
@@ -537,7 +537,15 @@ namespace WebSocketSharp.Server
/// The value specified for a set operation is .
///
///
- /// The value specified for a set operation is an empty string.
+ ///
+ /// The value specified for a set operation is an empty string.
+ ///
+ ///
+ /// -or-
+ ///
+ ///
+ /// The value specified for a set operation is an absolute root.
+ ///
///
public string RootPath {
get {
@@ -551,6 +559,16 @@ namespace WebSocketSharp.Server
if (value.Length == 0)
throw new ArgumentException ("An empty string.", "value");
+ value = value.TrimSlashOrBackslashFromEnd ();
+ if (value == "/")
+ throw new ArgumentException ("An absolute root.", "value");
+
+ if (value == "\\")
+ throw new ArgumentException ("An absolute root.", "value");
+
+ if (value.Length == 2 && value[1] == ':')
+ throw new ArgumentException ("An absolute root.", "value");
+
string msg;
if (!canSet (out msg)) {
_log.Warn (msg);
@@ -563,7 +581,7 @@ namespace WebSocketSharp.Server
return;
}
- _rootPath = value.TrimSlashOrBackslashFromEnd ();
+ _rootPath = value;
}
}
}