mirror of
https://codeberg.org/YGGverse/psocks.git
synced 2026-03-31 16:35:28 +00:00
validate remote list status
This commit is contained in:
parent
e967f881a4
commit
cb002bfb92
1 changed files with 8 additions and 1 deletions
|
|
@ -28,7 +28,14 @@ impl List {
|
||||||
let mut index = HashSet::new();
|
let mut index = HashSet::new();
|
||||||
for i in list {
|
for i in list {
|
||||||
for line in if i.contains("://") {
|
for line in if i.contains("://") {
|
||||||
reqwest::get(i).await?.text().await?
|
let response = reqwest::get(i).await?;
|
||||||
|
let status = response.status();
|
||||||
|
if status.is_success() {
|
||||||
|
response.text().await?
|
||||||
|
} else {
|
||||||
|
warn!("Could not receive remote list `{i}`: `{status}`");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fs::read_to_string(i).await?
|
fs::read_to_string(i).await?
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue