Skip to content

Commit

Permalink
only check HTTP_ACCESS_CONTROL_REQUEST_METHOD for options requests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsturgess committed Nov 9, 2023
1 parent af24b05 commit 9654854
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/apia/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def handle_request(env, api_path)

validate_api if development?

access_control_request_method = env['HTTP_ACCESS_CONTROL_REQUEST_METHOD']&.upcase
access_control_request_method = request_method == 'OPTIONS' ? env['HTTP_ACCESS_CONTROL_REQUEST_METHOD']&.upcase : nil
route = find_route((access_control_request_method || request_method), api_path)
if route.nil?
Apia::Notifications.notify(:request_route_not_found, notify_hash)
Expand Down

0 comments on commit 9654854

Please sign in to comment.