Re:API Shouldn't Redirect HTTP to HTTPS
by ants_everywhere on Wednesday May 29, 2024 @10:43AM
(#40512504)
Good point.
I guess this might depend a little on the implementation. In some cases the http endpoint may exist but may only be accessible to a sidecar container via localhost. For example, if the sidecar terminates https.
IMO, 400 is more accurate, but really either could be acceptable, so long as the client is notified of the error. But, I wouldn’t automatically redirect the client. That’s what we are trying to avoid.