feat: Support custom DNS resolver#728
Conversation
tustvold
left a comment
There was a problem hiding this comment.
I think this is probably fine, but generally we have tried to keep reqwest types out of our public API, especially in light of things like #724, and the fact we now support pluggable HTTP clients. The fact reqwest now has a resolve2 method, also doesn't really bode well for this API's stability longer-term 😅 It appears to have just been the legacy hyper API repackaged.
What do you think about defining our own resolve trait?
|
Can someone help me out -- is it possible to use a custom DNS resolver with a custom https://docs.rs/object_store/latest/object_store/client/trait.HttpConnector.html and wrapper around another client? |
|
Marking as draft as I think this PR is no longer waiting on feedback and I am trying to make it easier to find PRs in need of review. Please mark it as ready for review when it is ready for another look |
Which issue does this PR close?
Mitigates but does not close #726.
Rationale for this change
This PR enables users of object_store to provide a custom DNS resolver. Use case: the custom DNS resolver may have different properties (e.g., caching), and a different footprint (e.g., substantially smaller) than the default options.
What changes are included in this PR?
Enables override of the DNS resolver as used by the
reqwest::HttpClient.Are there any user-facing changes?
Yes. This PR adds
ClientOptions::with_dns_resolver(Arc<dyn reqwest::dns::Resolve>).