What HTTP error code should I use for unauthorised access to a protected image?
- by Bala Clark
I am writing a web application that has secure images uploaded by users. These images are only available to the owner when logged in. I am wondering what the best HTTP error code to throw in the case of unauthorised access? Would a 404 not found, or a 403 unauthorised be better?
I am leaning towards the 403, but would it be better to hide the fact that the resource exists to unauthorised users be better?