mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Handle origin when blocking content
This commit is contained in:
parent
074fc4a5e1
commit
a09773e819
1 changed files with 6 additions and 1 deletions
|
@ -862,10 +862,15 @@ pub fn load<A, B>(load_data: &LoadData,
|
|||
|
||||
let mut block_cookies = false;
|
||||
if let Some(ref rules) = *http_state.blocked_content {
|
||||
let same_origin =
|
||||
load_data.referrer_url.as_ref()
|
||||
.map(|url| url.origin() == doc_url.origin())
|
||||
.unwrap_or(false);
|
||||
let load_type = if same_origin { LoadType::FirstParty } else { LoadType::ThirdParty };
|
||||
let actions = process_rules_for_request(rules, &CBRequest {
|
||||
url: &doc_url,
|
||||
resource_type: to_resource_type(&load_data.context),
|
||||
load_type: LoadType::FirstParty, //FIXME need request origin
|
||||
load_type: load_type,
|
||||
});
|
||||
for action in actions {
|
||||
match action {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue