P
Paul Hatcher
I'm trying to test some functionality regarding relative URI's with the Uri
class in .NET 1.1 and hitting problems. The Uri class can only hold absolute
URIs, so there's a constructor that takes a URI and a string which is the
relative address.
However, some of the normative examples given in RFC 3986
(http://www.gbiv.com/protocols/uri/rfc/rfc3986.html) don't seem to be
handled by the class or give incorrect results.
For example, given a base address of http://a/b/c/d;p?q, the failing
normative examples are as follows...
"g:h" = "g:h" =>
System.UriFormatException : Invalid URI: The format of the URI could not be
determined
"//g" = "http://g" => http://g/ - Note
trailing /
"#s" = http://a/b/c/d;p?q#s => http://a/b/c/d;p#s
"../../../g" = http://a/g => http://a/../g
"../../../../g" = http://a/g => http://a/../../g
"/../g" = "http://a/g" => http://a/../g
Is this expected behaviour?
Paul
class in .NET 1.1 and hitting problems. The Uri class can only hold absolute
URIs, so there's a constructor that takes a URI and a string which is the
relative address.
However, some of the normative examples given in RFC 3986
(http://www.gbiv.com/protocols/uri/rfc/rfc3986.html) don't seem to be
handled by the class or give incorrect results.
For example, given a base address of http://a/b/c/d;p?q, the failing
normative examples are as follows...
"g:h" = "g:h" =>
System.UriFormatException : Invalid URI: The format of the URI could not be
determined
"//g" = "http://g" => http://g/ - Note
trailing /
"#s" = http://a/b/c/d;p?q#s => http://a/b/c/d;p#s
"../../../g" = http://a/g => http://a/../g
"../../../../g" = http://a/g => http://a/../../g
"/../g" = "http://a/g" => http://a/../g
Is this expected behaviour?
Paul