fix
This commit is contained in:
parent
5880a52a47
commit
f20cf41c39
2 changed files with 2 additions and 2 deletions
|
|
@ -188,7 +188,7 @@ impl<T: Clone> FederationConfig<T> {
|
|||
// TODO: Use is_global() once stabilized
|
||||
// https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_global
|
||||
let mut ips = lookup_host((domain.to_owned(), 80)).await?;
|
||||
let allow_local = std::env::var("APUB_DANGER_ALLOW_LOCAL_IP").is_ok();
|
||||
let allow_local = std::env::var("DANGER_FEDERATION_ALLOW_LOCAL_IP").is_ok();
|
||||
let invalid_ip = !allow_local
|
||||
&& ips.any(|addr| match addr.ip() {
|
||||
IpAddr::V4(addr) => {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ pub enum Error {
|
|||
#[error("URL failed verification: {0}")]
|
||||
UrlVerificationError(&'static str),
|
||||
/// Resolving domain points to local IP.
|
||||
#[error("Resolving domain {0} points to local IP {1}. This may indicate an attacker attempting to access internal services. If intentional, you can ignore this error by setting DANGER_APUB_ALLOW_LOCAL_IP=1")]
|
||||
#[error("Resolving domain {0} points to local IP {1}. This may indicate an attacker attempting to access internal services. If intentional, you can ignore this error by setting DANGER_FEDERATION_ALLOW_LOCAL_IP=1")]
|
||||
DomainResolveError(String, String),
|
||||
/// Incoming activity has invalid digest for body
|
||||
#[error("Incoming activity has invalid digest for body")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue