307 & 308 redirects (https://www.rfc-editor.org/rfc/rfc7538) is accepted by most modern browsers.
However upon google-ing a lot, I am unable to find a list of browser versions that support 307/308 redirects. Many of the posts like: What's the deal with HTTP status code 308? simply ask if 308 redirects is supported or not.
I am aware that some older browsers don't support 307/308 redirects (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308), but it's not clear which browser version doesn't.
So my question is, which browser versions support 307/308 redirects?
Also how do older browser handle this status code? Do they just fail?
You can detect browsers that support 308 responses by checking for the upgrade-insecure-requests HTTP header. This header was added to browsers in 2015 less than a year after support for 308 responses were added. Therefore you can bet that any browser sending a
upgrade-insecure-requests: 1
request header already supports 308 responses.The spec says that it must be sent along with requests for both insecure and secure URLs if HSTS is not preloaded.
The spec goes on to say that even if HSTS is preloaded, this header should still periodically be sent and in practice even with HSTS preloaded, it is always sent except when requesting embedded content like images.
When the header is not sent, it is easy to provide a fail-safe fallback that mimics a 308 response like this: