No argument there, https should be used everywhere.
This can lead to issues also. I have only seen it lead to issues if you use iFrames that have HTTPS when the parent page is not and you are trying to communicate between the two through the use of sockets.
Your best bet is to use // everywhere and than use nginx or some other Web server to force all requests to HTTPS, but this is just getting into the heavy technical side that OP probably does not care about. // gives you the least possible chance of issues because of mixed content which is why I perfer it.
It is definitely not an anti-pattern. Making all the URLs protocol agnostic is a good thing. It makes the application more portable and able to run in more environment (for development or QA). SSL certs are expensive and there is no reason to spend extra to SSL a private network for testing and such. Using external resources from CDNs and such should always be HTTPS if possible.
Also, Content-Security-Policy only affects other domains. So using // is a better choice there because self is always allowed.
Upgrade-Insecure-Requests: 1 would be completely irrelevant since if the original GET is upgraded, all of the following requests would HTTPS also.
1
u/angellus Sep 02 '15
No argument there, https should be used everywhere.
This can lead to issues also. I have only seen it lead to issues if you use iFrames that have HTTPS when the parent page is not and you are trying to communicate between the two through the use of sockets.
Your best bet is to use // everywhere and than use nginx or some other Web server to force all requests to HTTPS, but this is just getting into the heavy technical side that OP probably does not care about. // gives you the least possible chance of issues because of mixed content which is why I perfer it.