Re: Your API Shouldn’t Redirect HTTP to HTTPS

Published

Re: https://jviide.iki.fi/http-redirects (Hacker News: https://news.ycombinator.com/item?id=40504756)

The gist is just like the title: your API shouldn’t redirect http:// to https:// but instead should do one of the following:

Reading this was a d’oh!” moment for me, but I 100% agree. Auto upgrading or redirecting HTTP -> HTTPS requests is something that’s just became 2nd nature to me, especially with the shift of the Web going from largely-unencrypted to largely-encrypted thanks to availability of Let’s Encrypt. I still have a handful of domains that are backed by a server that I provisioned and configured manually which runs Nginx & Let’s Encrypt to handle HTTP and HTTPS connections plus renewing the TLS certificates. Not all software is running on a platform that handles it all automagically.

Some initial thoughts:

The article also enumerates a number of well-known” APIs and which ones are compliant to this behavior, which aren’t, and a few that even fail spectacularly i.e. respond in plaintext. This prompted me to check the APIs of a few lesser-known services and unfortunately the non-compliance pattern continues.


I love hearing from readers so please feel free to reach out.

Reply via emailSubscribe via RSS or email

Last modified  #re   #programming   #opinion 


← Newer post  •  Older post →