mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-02 14:02:22 +02:00
hls reverse proxy implemented
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user