Skip to content

Commit

Permalink
only send Referer HTTP header if the parent URL's scheme is http(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
snshn committed Sep 5, 2024
1 parent 65ac5c3 commit 82d05fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 82d05fc

Please sign in to comment.