Comments (5)
Hm, would it be possible to use URI::Generic's https://rubyapi.org/2.5/o/uri/generic#method-i-check_opaque
from faraday.
Apologies about that @pharmaceutics.
I've checked the code and indeed Utils.URI
can be configured to use other parsers as well, but in this scenario we need to call opaque which is not a very standard method.
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 default_uri_parser
?
from faraday.
@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 Addressable::URI
as a parser, if possible 🙏
from faraday.
@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 https://はじめよう.みんな/some|path
is automatically encoded as https://xn--p8j9a0d9c9a.xn--q9jyb4c/some%7Cpath
)
But there's probably no real reason why the URL couldn't be normalized separately first, with Faraday getting an already encoded version that would work with the regular Kernel#URI
from faraday.
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.
from faraday.
Related Issues (20)
- NoMethodError: undefined method `method=' for #<Faraday::RequestOptions (empty) HOT 5
- Faraday::Response - argument order causes unexpected behaviour HOT 3
- Incompatible with Firebase-admin-sdk HOT 1
- Streaming Stop with Connection Close? HOT 3
- `Faraday::Request::Json` doesn't encode the value `false` while it encodes `true` to `"true"` HOT 2
- Lots of "warning: method redefined; discarding old" printed during testing HOT 7
- Faraday using PUT with Transfer-Encoding: chunked
- Faraday::ParsingError.response_status doesn't return expected value when stubbing response HOT 5
- Missing HTTP 408 Request Timeout specific Faraday ClientError? HOT 3
- Dead link to Faraday Team in README and docs HOT 1
- Strange behaviour with response HOT 1
- Setting ActiveRecord DatabaseResolver to enable multi database does not work with Faraday adapter HOT 3
- Unable to use webdav verbs HOT 3
- Change connection proxy HOT 2
- Drop Ruby < 3.0 support HOT 1
- `no_proxy` Parameter in Manual Proxy Configuration HOT 4
- connection headers are ignored when using build_response directly HOT 5
- Add tests and documentation to make sure adapters support streaming requests HOT 2
- Any solution for Digest Auth in Faraday 2? HOT 2
- Case Insensitivity Issue with #dig Method on Response Headers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faraday.