Dean
Dean

Reputation: 5946

Uri.IsWellFormedUriString allows http://http://<url>

This seems strange to me but I am sure there is an explanation

If I use Uri.IsWellFormedUriString passing in "http://http://www.google.com" it returns true, I can only assume that this URI conforms to some RFC specification and is valid.

Most of my other tests indicate this method works in the manner in which I expect other than this one

Can anyone advise?

Upvotes: 1

Views: 681

Answers (1)

YWE
YWE

Reputation: 2909

I checked the BNF for a URI in RFC 3296 and it does conform.

It conforms because following the first "http://" is a registry-based naming authority followed by an absolute path. "http:" conforms to the registry-based naming authority, and "//www.google.com" conforms to the absolute path.

Upvotes: 2

Related Questions