Skip to content

Commit

Permalink
Handle origin when blocking content
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed May 30, 2016
1 parent 8e61ae3 commit 6a59e9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/net/http_loader.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 6a59e9e

Please sign in to comment.