Open hackedd opened 4 years ago
Facing the same problem.
Found a temporary solution.
Clone falcon_cors from GitHub, and in init.py change _get_resourcemethods 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.