uri-templates icon indicating copy to clipboard operation
uri-templates copied to clipboard

Catch failed percent-decode

Open geraintluff opened this issue 10 years ago • 2 comments

URLs such as some%thing -> {url} will throw because %th is not a valid character. We should catch these and treat them as failures.

geraintluff avatar May 27 '15 17:05 geraintluff

I think that this is expected behavior and nothing should be done by this library about it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError.

gr0uch avatar Aug 11 '15 13:08 gr0uch

True - however, in situations where you're pattern matching (e.g. using this module in a routing table), throwing exceptions is might be impolite.

geraintluff avatar Oct 01 '15 10:10 geraintluff