From f131ef6c24c331de2d24101217e55155b4c0219e Mon Sep 17 00:00:00 2001 From: Sunshine Date: Thu, 5 Sep 2024 22:25:33 +0000 Subject: [PATCH] only send Referer HTTP header if the parent URL's scheme is http(s) --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index 9eda28a1..1a5e0522 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -299,7 +299,7 @@ pub fn retrieve_asset( } } // Add referer header for page resource requests - if parent_url != url { + if ["https", "http"].contains(&parent_url.scheme()) && parent_url != url { headers.insert( REFERER, HeaderValue::from_str(get_referer_url(parent_url.clone()).as_str()).unwrap(),