Why Grails see URLs without http:// (like http://www.google.com) as invalid?
Only http://google.com and http://www.google.com are ok.
Is there any way to fix that ?
Why Grails see URLs without http:// (like www.google.com) as invalid? Only http://google.com and http://www.google.com
Share
If you read RFC 1738 (Uniform Resource Locators), it is clear that the URL scheme (in your case, http://), is a full part of URLs. The scheme defines the meaning of the rest of the URL, and thus, can’t be omitted. For instance http://www.google.com is definitely not the same ressource as https://www.google.com, and you should be aware of that when you save a link.
So URL like
www.google.comare not valid, and Grails is right when it rejects them.Fixing that should be easy if you know you expect an http URL:
should do the trick.