Commit 1a11345e authored by Rémy Coutable's avatar Rémy Coutable

Ensure #route_setting is available before calling it

In the context of an exception, #route_setting is not available.

See:

- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14178#note_40259442
- https://github.com/ruby-grape/grape/blob/df79bc35e43f0d5b6cbd666b587cf4640de174b8/lib/grape/middleware/error.rb#L59Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 36f02298
---
title: 'Ensure #route_setting is available before calling it'
merge_request: 2908
author:
type: fixed
...@@ -106,6 +106,8 @@ module API ...@@ -106,6 +106,8 @@ module API
private private
def route_authentication_setting def route_authentication_setting
return {} unless respond_to?(:route_setting)
route_setting(:authentication) || {} route_setting(:authentication) || {}
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment