mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 04:06:54 +00:00
chore: Fix more merge issues and removed methods
This commit is contained in:
3 files changed
+4
-12
No files matched your search
@@ -192,7 +192,9 @@ impl super::Service {
|
||||
if let Some(url_host) = url.host_str() {
|
||||
if let Ok(ip) = IPAddress::parse(url_host) {
|
||||
trace!("Checking request URL IP {ip:?}");
|
||||
self.services.resolver.validate_ip(&ip)?;
|
||||
if !self.services.client.valid_cidr_range(&ip) {
|
||||
return Err!(BadServerResponse("Not allowed to send requests to this IP"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -5,8 +5,7 @@ pub mod fed;
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use conduwuit::{Err, Result, implement};
|
||||
use ipaddress::IPAddress;
|
||||
use conduwuit::Result;
|
||||
use resolvematrix::server::{MatrixResolver, MatrixResolverBuilder};
|
||||
|
||||
use self::{cache::Cache, dns::Resolver};
|
||||
@@ -56,12 +55,3 @@ impl crate::Service for Service {
|
||||
|
||||
fn name(&self) -> &str { crate::service::make_name(module_path!()) }
|
||||
}
|
||||
|
||||
#[implement(Service)]
|
||||
pub fn validate_ip(&self, ip: &IPAddress) -> Result<()> {
|
||||
if !self.services.client.valid_cidr_range(ip) {
|
||||
return Err!(BadServerResponse("Not allowed to send requests to this IP"));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user