2 ms·
My favorite pattern is serve all the content on http and https, but set the favicon to be fetched via https, and serve that with hsts. Preload hsts if you can.
by toast0 3y ago
My favorite pattern is serve all the content on http and https, but set the favicon to be fetched via https, and serve that with hsts. Preload hsts if you can. (Handling Upgrade-insecure-request seems good, too)
Then, modern browsers will use https after the first load and older browsers will use https, but probably not fetch the favicon.
It doesn't really hurt to return content instead of a redirect to connections that come in via http, if the user is being MITMed, they could make a http request and the MITM could make a https request and the server wouldn't know, and can't do anything about.
http makes passive observation easier of course, but there's not a huge difference between having the content and having a redirect to content that an observer could also load.