karenetheridge / OpenAPI-Modern

Validate HTTP requests and responses against an OpenAPI v3.1 document
https://metacpan.org/release/OpenAPI-Modern/
Other
6 stars 3 forks source link

properly handle unicode characters in the path template #40

Open karenetheridge opened 2 years ago

karenetheridge commented 2 years ago

At present, ascii sorting is used when considering path templates to match against a concrete URI. Because of {'s placement in byte representation, all literal path segments are considered for templated path segments (with the exception of ~), but segments starting with a unicode character will take lower precedence.

Use a custom sorting algorithm so that all templated segments are considered after literal segments.

(note that path templates are not URL-encoded.)

karenetheridge commented 1 year ago

or, use (or write!) a custom routing algorthm that handles uri templates natively. URI::Template::Modern anyone?

see also https://www.youtube.com/watch?v=cq_uQFf5bro