ensure proxy urls have a host in front and not simple "/" path
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user