diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 15:09:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 15:09:24 +0000 |
commit | f8d15ca65390475e356b06dedc51e10ccd179f86 (patch) | |
tree | ef916d4e8e11c9e00d809e5cdcf63814e86d6e89 /lib/api/internal | |
parent | 3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad (diff) | |
download | gitlab-ce-f8d15ca65390475e356b06dedc51e10ccd179f86.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/internal')
-rw-r--r-- | lib/api/internal/base.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index 577a6e890d7..ba66404e406 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -50,7 +50,11 @@ module API @project ||= access_checker.project result rescue Gitlab::GitAccess::ForbiddenError => e - return response_with_status(code: 403, success: false, message: e.message) + # The return code needs to be 401. If we return 403 + # the custom message we return won't be shown to the user + # and, instead, the default message 'GitLab: API is not accessible' + # will be displayed + return response_with_status(code: 401, success: false, message: e.message) rescue Gitlab::GitAccess::TimeoutError => e return response_with_status(code: 503, success: false, message: e.message) rescue Gitlab::GitAccess::NotFoundError => e |