Skip to content

Commit 8057117

Browse files
monsieurleberredmitryplatonov
authored andcommitted
Enhancement: Bypass permission check for OPTIONS HTTP method (#1350)
Co-authored-by: Dmitry Platonov <dmitry.platonov@gmail.com>
1 parent 90d3051 commit 8057117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/authorize_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def authorize
2929
return access_error!('authz.permission_denied', 401) if req.under_path_rules?('block')
3030

3131
response.status = 200
32-
return if req.under_path_rules?('pass') # check if request is whitelisted
32+
return if request.env['REQUEST_METHOD'] == "OPTIONS" || req.under_path_rules?('pass') # check if request is whitelisted
3333

3434
response.headers['Authorization'] = req.auth # sets bearer token
3535
rescue Barong::Authorize::AuthError => e # returns error from validations

0 commit comments

Comments
 (0)