• 1 Post
  • 192 Comments
Joined 2 years ago
cake
Cake day: July 7th, 2023

help-circle



  • Eager Eagle@lemmy.worldtoProgrammer Humor@programming.devYes, But...
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    10 days ago

    It depends on the context. If it’s an URL that is easy to guess and reflects user-created content, your system is leaking information about their users if it returns 403. The example that comes to mind is GitHub returning 404s for both nonexisting and private repos when the authenticated user doesn’t have access to it.




  • Eager Eagle@lemmy.worldtoProgrammer Humor@programming.devYes, But...
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    10 days ago

    A 2xx means success to its requester. If you have an error in step 6 out of 13 that breaks the resource action, you shouldn’t be returning a success.

    You might argue what to return and what kind of information to include in the response (like tracking numbers), but it shouldn’t be a 2xx and I don’t see how a misleading 200 would be more helpful than a 400 bad request.