URL class


#1

I think it needs a little bit of work. I think the existing class should be renamed to HttpUrl or something.

Anyways, it’d be nice to have the isProbablyAWebsiteURL function rewritten. For example: http://xjakel7/site/ would be a perfectly valid URL and is definitely a perfectly valid website url. I believe there is an rfc document or something that had the URL stuff down. probably rfc1738

NVM me…I just like to talk.


#2

isProbablyAWebsiteURL isn’t supposed to be a standards-compliant test, it’s just a utility function you might use to check something that a user has entered, perhaps to see whether they seem to be talking about a file, an email address or an internet address.

But having a quick look at it again, it does look like a few tweaks are in order - e.g. in your example the “http:” should be enough to make it return true, rather than also needing a top level domain. I’ll have a quick poke around and see what I can do.