• The_Decryptor@aussie.zone
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 hours ago

    Well no, the HTTP error codes are about the entire request, not just whether or not the actual header part was received and processed right.

    Like HTTP 403, HTTP only has a basic form of authentication built in, anything else needs the server to handle it externally (e.g. via session cookies). It wouldn’t make sense to send “HTTP 200” in response to trying to access a resource without being logged in just because the request was well formed.

    • porkloin@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 hours ago

      Many GraphQL and gRPC APIs do exactly that and return HTTP 200 even if the request didn’t auth.

      Just because you are heavily biased toward using HTTP status for application layer errors doesn’t make it right. It is so wildly common that people can’t imagine it working another way, and I get that.

      But it’s not “wrong” to do application layer auth status codes and apply no transport layer auth status codes It’s just a different paradigm than most devs are used to.