mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 20:26:52 +00:00
fix: Don't try to use system resolv.conf when other servers are configured
Previously, only HTTP clients targeting matrix servers (and using the resolution spec) would use the DNS servers configured in the c10y config. This happened because reqwest requires any DNS resolvers passed in to implement reqwest::dns::Resolve, which only the matrix resolver did, and no other HTTP client had a proper DNS resolver (which used the configured DNS servers) passed into it. To fix this we make a custom resolution struct based on reqwest's reqwest::dns::HickoryDnsResolver, which implements Request with no other modifications to the DNS response. HickoryDnsResolver itself isn't exported, which is why we re-created it instead of using it directly. no im not an LLM i just wrote this to remember my own changes later on Fixes: continuwuation/continuwuity#2441
This commit is contained in:
1 parent
f4f0a69fe4
commit
a484c28f99
3 files changed
+119
-43
No files matched your search
@@ -983,7 +983,8 @@ impl crate::Context<'_> {
|
||||
let resolver: &MatrixResolver = if no_cache {
|
||||
&MatrixResolverBuilder::new()
|
||||
.dangerous_tls_accept_invalid_certs(self.services.server.config.allow_invalid_tls_certificates_yes_i_know_what_the_fuck_i_am_doing_with_this_and_i_know_this_is_insecure)
|
||||
.http_client(self.services.client.dns.clone())
|
||||
.http_client(self.services.client.matrix_http_client.clone())
|
||||
.dns_resolver(self.services.client.dns_resolver.clone())
|
||||
.build()?
|
||||
} else {
|
||||
&self.services.client.matrix_resolver
|
||||
|
||||
Reference in new issue
Block a user