Decode percent-encoded tags and filter release artifacts

This commit is contained in:
2026-07-08 21:14:00 +03:00
parent f6b722b22a
commit 2e80f7b8eb
8 changed files with 179 additions and 9 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
use crate::models::{SubscriptionCache, SubscriptionServer};
use crate::models::{decode_percent_encoded_utf8, SubscriptionCache, SubscriptionServer};
use base64::{engine::general_purpose, Engine};
use serde_json::{json, Map, Value};
use std::time::{SystemTime, UNIX_EPOCH};
@@ -192,7 +192,10 @@ fn parse_vless_url(raw_url: &str) -> Result<Value, SubscriptionError> {
}
let parsed = Url::parse(raw_url).map_err(|_| SubscriptionError::new("Invalid VLESS URL"))?;
let tag = parsed.fragment().unwrap_or("vless-out").to_string();
let tag = parsed
.fragment()
.map(decode_percent_encoded_utf8)
.unwrap_or_else(|| "vless-out".to_string());
let uuid = parsed.username().trim().to_string();
let server = parsed.host_str().map(str::to_string).unwrap_or_default();
let server_port = parsed.port_or_known_default().unwrap_or(443);