Re: URLField should allow scheme to be empty

2013-04-03 Thread Alex Ogier
After poking around a bit[1], it appears that URLFields are used almost exclusively for canonical links to webpages, and are not typically used as, say, the target of internal redirects, or resources that are loaded on a page. In addition, it looks like the code from ticket 5331 that automatically

Re: URLField should allow scheme to be empty

2013-04-03 Thread Atul Bhouraskar
As per RFC 3986 (see section 4, in particular 4.2) all of the following are valid: Absolute URI http://www.example.com/images/xyz.png Network path reference //www.example.com/images/xyz.png Suffix reference (frowned upon but valid?) www.example.com/images/xyz.png Absolute path reference /images

Re: URLField should allow scheme to be empty

2013-04-03 Thread Alex Ogier
Don't add an option, it's not needed. URLs with blank schemas are valid, it's just a bug that Django adds 'http://' in that case. So make a ticket, +1 from me. Best, Alex Ogier On Wed, Apr 3, 2013 at 4:24 PM, Juan Pablo Martínez wrote: > I love it. > If URLField has an option like "scheme_requi

Re: URLField should allow scheme to be empty

2013-04-03 Thread Juan Pablo Martínez
I love it. If URLField has an option like "scheme_required=False" or something like that. No behaviour is the "correct", append or not append scheme. The option to our needs seems to be more correct. Regards, On Wed, Apr 3, 2013 at 5:14 PM, SteveB wrote: > How to avoid those browser warnings ab

URLField should allow scheme to be empty

2013-04-03 Thread SteveB
How to avoid those browser warnings about mixing secure and insecure content on a web page? Wouldn't it be great to be able to specify a URL for a resource (be it a script, image, iframe etc.) such that if the current page is insecure (using a http:// scheme) the content would be fetched using