You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I register a resource with a suffix specified in the add_route call, preflight requests to that resource fail with Aborting response due to unallowed method because _get_resource_methods returns an empty list.
Setting allow_all_methods=True does not help, each request is still checked against the list of methods on the resource.
The example in this gist illustrates the problem. When you run it, it outputs:
Without: ['GET', 'POST']
With suffix: []
Making a CORS POST to /a succeeds, while the same request to /b fails with the unallowed method message.
The text was updated successfully, but these errors were encountered:
Clone falcon_cors from GitHub, and in init.py change _get_resource_methods function, so hasattr(resource, 'on_' + method.lower()) becomes next((s for s in dir(resource) if method.lower() in s), None).
Everything it does is searching for request method substring in resource attributes.
When I register a resource with a suffix specified in the
add_route
call, preflight requests to that resource fail with Aborting response due to unallowed method because_get_resource_methods
returns an empty list.Setting
allow_all_methods=True
does not help, each request is still checked against the list of methods on the resource.The example in this gist illustrates the problem. When you run it, it outputs:
Making a CORS POST to
/a
succeeds, while the same request to/b
fails with the unallowed method message.The text was updated successfully, but these errors were encountered: