hls reverse proxy implemented

This commit is contained in:
euzu
2025-03-14 13:15:26 +01:00
parent b806ed8166
commit f7eb465bd8
22 changed files with 308 additions and 216 deletions
+8
View File
@@ -41,3 +41,11 @@ pub fn get_trimmed_string(value: &Option<String>) -> Option<String> {
}
None
}
pub fn replace_after_last_slash(input: &str, replacement: &str) -> String {
match input.rsplitn(2, '/').collect::<Vec<&str>>().as_slice() {
[_after, before] => format!("{before}/{replacement}"),
[_only] => replacement.to_string(), // if there is no slash, replace complete
_ => input.to_string(), // fallback, should never happen
}
}