addressable icon indicating copy to clipboard operation
addressable copied to clipboard

`Addressable::Template#match` raises `Addressable::URI::InvalidURIError` on invalid string

Open ojab opened this issue 5 years ago • 0 comments

> Addressable::Template.new('https://{domain}').match('x;x:x')
# => …/gems/addressable-2.7.0/lib/addressable/uri.rb:901:in `scheme=': Invalid scheme format: x;x (Addressable::URI::InvalidURIError)

Not sure if it's a bug, but I don't see that .match could raise documented anywhere and IMHO there is an expectation to have nil on any data that doesn't match the template, not only on valid URIs.

ojab avatar Apr 12 '21 10:04 ojab