2
Vote

IsValidUrl problem

description

I've checked your tests:
 
[TestMethod()]
    public void IsValidUrlTest()
    {
        Assert.IsTrue("http://www.codeproject.com".IsValidUrl());
        Assert.IsTrue("https://www.codeproject.com/#some_anchor".IsValidUrl());
        Assert.IsTrue("https://localhost".IsValidUrl());
        Assert.IsTrue("http://www.abcde.nf.net/signs-banners.jpg".IsValidUrl());
        Assert.IsTrue("http://aa-bbbb.cc.bla.com:80800/test/test/test.aspx?dd=dd&id=dki".IsValidUrl());
        Assert.IsFalse("http:wwwcodeprojectcom".IsValidUrl());
        Assert.IsFalse("http://www.code project.com".IsValidUrl());
}
 
But a simple "codeplex.com" is a validUrl. I don't think thats correct as its missing http/https etc.

comments

kevinnessland wrote Oct 28, 2009 at 9:00 PM

Thanks for the catch. I'll take a look at this right away :)

wrote Oct 29, 2009 at 4:21 AM

wrote Oct 29, 2009 at 4:24 AM

Resolved with changeset 37600.

kevinnessland wrote Oct 29, 2009 at 7:57 AM

** Closed by kevinnessland 10/28/2009 9:24 PM

jmvermeulen wrote Oct 29, 2009 at 7:57 AM

Thanks for this quick fixing!

But I've got another bug here:
http://me@site.com is seen as valid, but
http://me:me@site.com is not seen as a valid url.

Also
http://wwwww.me.www.something.else is valid..
I believe you can only have a subdomain.domain.tld

wrote Jun 20, 2011 at 7:17 PM

wrote Feb 2, 2013 at 2:11 AM