Skip to content

Instantly share code, notes, and snippets.

@comet0
Created September 1, 2019 19:49
Show Gist options
  • Save comet0/2dd6fc0d08b4468db66b6e5f85af0c2b to your computer and use it in GitHub Desktop.
Save comet0/2dd6fc0d08b4468db66b6e5f85af0c2b to your computer and use it in GitHub Desktop.
import falcon
class TestResponse():
def on_get(self, req, resp):
resp.body = "Success"
resp.content_type = falcon.MEDIA_TEXT
application = falcon.API()
# http://localhost/item/19/01/01/Item-190101-59559ee7-e661-43c8-9da1-0ab83b9e0d8e.json
application.add_route("/item/{y:int}/{m:int}/{d:int}/Item-{yymmdd:int}-{item_id:uuid}.json", TestResponse())
application.add_route("/item2/{y:int(2)}/{m:int(2)}/{d:int(2)}/Item-{yymmdd:int(6)}-{item_id:uuid}.json", TestResponse())
@vytas7
Copy link

vytas7 commented Sep 1, 2019

Thanks for reporting!
Although this was "sort of known" for Falcon developers, I filed this as a new issue: falconry/falcon#1567
Even if we cannot afford fixing this soon, we should at least clearer document the current limitations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment