Compare commits
19 Commits
b3dfe6b3e2
...
master
Author | SHA1 | Date | |
---|---|---|---|
9f396f6f90 | |||
a315151dda | |||
28581909a4 | |||
1fbf518b8a | |||
ebd043f020 | |||
71811665c8 | |||
f70607f818 | |||
4e0f4d4521 | |||
a1eedcbeb7 | |||
373f54e06e | |||
52cca797da | |||
a75ef10f3c | |||
17598abdf4 | |||
a9c0768ab4 | |||
13946ed35f | |||
c92a337c60 | |||
2d4c3af291 | |||
113c414f31 | |||
2a20aad6e1 |
22
Cargo.lock
generated
22
Cargo.lock
generated
@@ -21,9 +21,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-files"
|
name = "actix-files"
|
||||||
version = "0.6.6"
|
version = "0.6.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0773d59061dedb49a8aed04c67291b9d8cf2fe0b60130a381aab53c6dd86e9be"
|
checksum = "6c0d87f10d70e2948ad40e8edea79c8e77c6c66e0250a4c1f09b690465199576"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-http",
|
"actix-http",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
@@ -31,7 +31,7 @@ dependencies = [
|
|||||||
"actix-web",
|
"actix-web",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytes",
|
"bytes",
|
||||||
"derive_more 0.99.19",
|
"derive_more 2.0.1",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"http-range",
|
"http-range",
|
||||||
"log",
|
"log",
|
||||||
@@ -432,9 +432,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.41"
|
version = "4.5.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
|
checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@@ -442,9 +442,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.41"
|
version = "4.5.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
|
checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -454,9 +454,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.41"
|
version = "4.5.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
|
checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -1117,9 +1117,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.27"
|
version = "0.4.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
|
@@ -7,12 +7,12 @@ license = "GPL-3.0-only"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.5.41", features = ["derive", "env"] }
|
clap = { version = "4.5.48", features = ["derive", "env"] }
|
||||||
actix-web = "4.11.0"
|
actix-web = "4.11.0"
|
||||||
actix-files = "0.6.6"
|
actix-files = "0.6.8"
|
||||||
actix-multipart = "0.7.2"
|
actix-multipart = "0.7.2"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
log = "0.4.27"
|
log = "0.4.28"
|
||||||
bytes = "1.10.1"
|
bytes = "1.10.1"
|
||||||
futures-util = { version = "0.3.31", default-features = false, features = ["std"] }
|
futures-util = { version = "0.3.31", default-features = false, features = ["std"] }
|
||||||
tar = "0.4.44"
|
tar = "0.4.44"
|
||||||
|
@@ -84,9 +84,9 @@ fn get_remote_ip(req: &HttpRequest, args: &Args) -> String {
|
|||||||
let mut ip = req.peer_addr().unwrap().ip().to_string();
|
let mut ip = req.peer_addr().unwrap().ip().to_string();
|
||||||
|
|
||||||
// We check if the request comes from a trusted reverse proxy
|
// We check if the request comes from a trusted reverse proxy
|
||||||
if let Some(proxy) = args.proxy_ip.as_ref() {
|
if let Some(proxy) = args.proxy_ip.as_ref()
|
||||||
if match_ip(proxy, &ip) {
|
&& match_ip(proxy, &ip)
|
||||||
if let Some(header) = req.headers().get("X-Forwarded-For") {
|
&& let Some(header) = req.headers().get("X-Forwarded-For") {
|
||||||
let header: Vec<String> = header
|
let header: Vec<String> = header
|
||||||
.to_str()
|
.to_str()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -98,8 +98,6 @@ fn get_remote_ip(req: &HttpRequest, args: &Args) -> String {
|
|||||||
ip = header[0].to_string();
|
ip = header[0].to_string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ip
|
ip
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user