Skip to content

Commit

Permalink
fix: use 403 for authorization errors
Browse files Browse the repository at this point in the history
401 is called "unauthorized" but this is a bug in the HTTP spec - see https://stackoverflow.com/questions/3297048/403-forbidden-vs-401-unauthorized-http-responses

403 should be used if a user is correctly authenticated but does not have sufficient permission to perform an action
  • Loading branch information
amcgee authored Sep 30, 2024
1 parent 6e5ae5f commit 28c9f29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/routes/v1/apps/handlers/createAppVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
isManager || userApps.map(app => app.app_id).indexOf(appId) !== -1

if (!userCanEditApp) {
throw Boom.unauthorized()
throw Boom.forbidden()
}

const versionPayload = request.payload.version
Expand Down

0 comments on commit 28c9f29

Please sign in to comment.