• v9CYKjLeia10dZpz88iU@programming.dev
    link
    fedilink
    arrow-up
    23
    ·
    edit-2
    6 months ago

    I disagree.

    You shouldn’t serve anything over http. (The article argues that there’s risk of leaking user data) Whatever you’re using for a webserver should always catch it. A 301/308 redirect is also cached by browsers, so if the mistake is made again, the browser will correct it itself.

    If you make it fail, you’re just going to result in user confusion. Did they visit the right website? Is their internet down? etc.

    • vithigar@lemmy.ca
      link
      fedilink
      arrow-up
      46
      ·
      edit-2
      6 months ago

      This article isn’t about browsers or websites, and even acknowledges in the opening that it makes sense as a usability tradeoff in that context.

      • v9CYKjLeia10dZpz88iU@programming.dev
        link
        fedilink
        arrow-up
        18
        ·
        6 months ago

        I clearly didn’t read it. It makes sense, if users aren’t visiting the API then it really doesn’t matter that it’s not redirected on insecure connections.

        • pinchcramp@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          10
          ·
          edit-2
          6 months ago

          I clearly didn’t read it.

          I love the honesty. It’s really refreshing to see someone take accountability instead of becoming defensive.

    • Mikina@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      6 months ago

      I’d like to mention one exception, because it took me ages to properly debug.

      If your endpoint is serving mirrors for APT, don’t redirect to HTTPS.

      APT packages are signed and validated, so there is no need to use TLS. Lot of docker images (such as Kali) do not have root certificates by default, so they can’t use the TLS, because cert validation fails. You also can’t install the certificates, because they install through APT. If your local mirror redirects to https by default, it will break it for people who choose the mirror, which IIRC happens automatically based on what’s closest to you. I think this issue is still there for Czech Kali package mirror, and it took me so long to figure out (because it’s also not an issue for most of the users, since they have different mirrors), so I like mentioning this when talking http/s. It’s an edge case, but one that I find interresting - mostly because it would never occur to me that this can be an issue, when setting up a mirror.

      But that was more than a year ago, it may be better now.