ensure proxy urls have a host in front and not simple "/" path

This commit is contained in:
Simon
2026-06-23 06:33:03 +00:00
parent 614361f0f3
commit 0402e5ac76
3 changed files with 79 additions and 0 deletions

View File

@@ -194,6 +194,22 @@ impl VideoItem {
self
}
/// Re-applies the request host to every host-relative proxy URL on this item
/// (its `url`, `preview`, and each format's `url`). Cached items may have been
/// built without a host; see [`crate::providers::ensure_proxy_url_host`].
pub fn ensure_proxy_host(&mut self, public_url_base: &str) {
self.url = crate::providers::ensure_proxy_url_host(&self.url, public_url_base);
if let Some(preview) = &self.preview {
self.preview =
Some(crate::providers::ensure_proxy_url_host(preview, public_url_base));
}
if let Some(formats) = &mut self.formats {
for format in formats.iter_mut() {
format.url = crate::providers::ensure_proxy_url_host(&format.url, public_url_base);
}
}
}
#[cfg(any(
not(hottub_single_provider),
hottub_provider = "chaturbate",