Leave off the http: or https: if you have a resource that can be called over both secure and non-secure means.
TIL: The protocol-relative URL
One response to “TIL: The protocol-relative URL”
Warning — I’m grumpy today.
Problem: what’s to prevent software from just turning any old link-like-thing into a bogus link? Imagine how annoying it’d be for a blog engine or other hyperlink aware application to turn something like 2014/may/7 into a hyperlink.
Call me old fashioned, but this is unacceptable. URLs are by definition required to have a protocol associated with them. It’s right in the RFC.
I have a better idea — get off your butts and migrate everything to run under https:, and then you can affix https: to all your URLs, uniformly. Problem solved AND the RFC retains its relevance.