107
Your API Shouldn't Redirect HTTP to HTTPS
(jviide.iki.fi)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
It's interesting that the author and most others went with 403, when 426 seems to be the most appropriate.
Neither are perfect matches, since 403 is about authentication and 426 is for Upgrade semantics (i.e. the upgrade is over the same transport protocol, not switching from http to https). npm isn't sending an Upgrade header, which is required, but I think if it sent
Upgrade: TLS/1.0, HTTP/1.1
then that would be claiming they supported TLS on port 80 (STARTTLS style) - possible but unconventional.