hivesolutions / appier

Joyful Python Web App development
http://appier.hive.pt
Apache License 2.0
127 stars 22 forks source link

Bug: Appier routes don't support resource names with special characters #48

Closed joao-conde closed 3 years ago

joao-conde commented 3 years ago

Description

Appier routes like this:

@appier.route("/api/orders/<int:number>/attachments/<str:attachment_name>", "GET", json = True)

work as expected and match with an URL such as:

https://URL/api/9999/attachments/docname.pdf

However, they do not match the following two:

https://URL/api/9999/attachments/doc%20name.pdf
https://URL/api/9999/attachments/docname(1).pdf

It seems spaces and parenthesis are not supported. The resources are encoded by the likes of a method like JavaScripts' encodeURIComponent and are valid URL syntax, so they should be supported.

joao-conde commented 3 years ago

@joamag Evaluate the format of the open issue please, I can include more information if need be. Also, I can't add the proper labels or assignees.

joamag commented 3 years ago

that's expected for that you need to use the regex() version instead of the str one which only supports basic Latin characters