Groups > Asp .Net > HttpHandlers and HttpModules > Re: Full stop in URL gets truncated




Full stop in URL gets truncated

Full stop in URL gets truncated
Fri, 29 Feb 2008 15:14:37 +000
Try this one: 

New Uri("http://www.site.com/folder./").ToString
Result:  http://www.site.com/folder/ (full stop gone!)


I have a list of URLs that I request via HttpWebRequest but the ones with full
stop in the end of the folder always get 404 error for obvious reasons :(
Why is the full stop disappearing and how can I stop this behaviour. 

I've been struggling with this for a whole day so I would really appreciate any
help. Thanks!
Post Reply
Re: Full stop in URL gets truncated
Fri, 29 Feb 2008 17:31:23 +000
Interesting. It appears to be a mistake in the Uri class implementation.

Microsoft's documentation for the URI class
(http://msdn2.microsoft.com/en-us/library/system.uri.aspx) references the IETF's
RFC 2396 and RFC 3986 which appear to allow the
scheme you you are providing.

FROM RFC 3986
(http://www.ietf.org/rfc/rfc3986.txt):

   Each URI begins with a scheme name that refers to a specification for
   assigning identifiers within that scheme.  As such, the URI syntax is
   a federated and extensible naming system wherein each scheme's
   specification may further restrict the syntax and semantics of
   identifiers using that scheme.

   Scheme names consist of a sequence of characters beginning with a
   letter and followed by any combination of letters, digits, plus
   ("+"), period ("."), or hyphen ("-").  Although
schemes are case-
   insensitive, the canonical form is lowercase and documents that
   specify schemes must do so with lowercase letters.  An implementation
   should accept uppercase letters as equivalent to lowercase in scheme
   names (e.g., allow "HTTP" as well as "http") for the sake
of
   robustness but should only produce lowercase scheme names for
   consistency.

      scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" /
"." )
Post Reply
Re: Full stop in URL gets truncated
Fri, 29 Feb 2008 18:09:41 +000
Thanks for your answer.
 I read the RFC 3986 and it
confirms that my scheme should be possible (Page 36)

Unfortunately it seems that the URI class does not follow the RFC standard
precisely. Can anyone offer a workaround for this issue?
Post Reply
about | contact