[Mono-list] Problem with URI

John Anderson sontek at gmail.com
Sun Sep 16 19:58:53 EDT 2007


Right now unix paths are being accepted as a valid absolute path, but in
ms.net the path "/test.aspx"  is relative

and since there is no real way to differentiate between the 2 I suggest we
force unixpaths to have file:// on them
or we can do a specific check when passing UriKind.Relative to accept rooted
locations like /test.aspx

heres the patch to force file:// on unix paths

Index: System/Uri.cs
===================================================================
--- System/Uri.cs   (revision 85855)
+++ System/Uri.cs   (working copy)
@@ -1262,10 +1262,7 @@
                    + "The format of the URI could not be "
                    + "determined.");
            } else if (pos < 0) {
-               // It must be Unix file path or Windows UNC
-               if (uriString [0] == '/')
-                   ParseAsUnixAbsoluteFilePath (uriString);
-               else if (uriString.Length >= 2 && uriString [0] == '\\' &&
uriString [1] == '\\')
+               if (uriString.Length >= 2 && uriString [0] == '\\' &&
uriString [1] == '\\')
                    ParseAsWindowsUNC (uriString);
                else {
                    /* Relative path */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070916/80315f89/attachment.html 


More information about the Mono-list mailing list