-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.7.3 breaks compatibility with Addressable as URI parser #1484
Comments
Hm, would it be possible to use URI::Generic's https://rubyapi.org/2.5/o/uri/generic#method-i-check_opaque |
Apologies about that @pharmaceutics. I don't like this open-ended configurability, since we don't have a way to enforce that the configured parser returns an object that behaves exactly like a URI, but I'm happy to change this to bring back compatibility as it was before. Just as a curiosity, why do you override the |
Utils.URI can be configured to use a different parser and return an object that "behaves like a URI". However, `opaque` is not available in other objects (e.g. Addressable::URI), so in this instance we need to use URI. Fixes #1484
Utils.URI can be configured to use a different parser and return an object that "behaves like a URI". However, `opaque` is not available in other objects (e.g. Addressable::URI), so in this instance we need to use URI. Fixes #1484
@pharmaceutics PR with a fix is merged and released as v2.7.4 👍 I'd still be interested to hear about your use-case to use |
@iMacTia thanks a lot! The actual parser in the code looked like this Faraday::Utils.default_uri_parser = -> (v) { Addressable::URI.parse(v).normalize } and two use cases I see tested are handling IDNAs and path parts with invalid characters that both wouldn't normally work (for example, with Addressable |
Thanks @pharmaceutics, it doesn't seem like an extremely useful feature and it does create some maintainance issues, so it's likely we'll remove it on the next major version. |
Basic Info
Issue description
Not sure if it's still officially supported, but in the past, Faraday allowed replacing the default URI parser with a custom one (like
Addressable::URI#parse
). It was working fine before 2.7.3, but due to changes in #1481 Addressable is no longer compatible.The example below works fine with 2.7.2, but with 2.7.3 throws:
Steps to reproduce
The text was updated successfully, but these errors were encountered: