Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History API #11220

Closed
wants to merge 10 commits into from

Don't check cross-origin if the Url is not changed

  • Loading branch information
cbrewster committed May 28, 2016
commit bc90533a38636e918f8395d9c038048f5f4919ec
@@ -180,17 +180,18 @@ impl BrowsingContext {
let url = match url {
Some(url) => {
match active_document.url().join(&url) {
Ok(url) => url,
Ok(url) => {
if !UrlHelper::SameOrigin(&url, active_document.url()) {
return Err(Error::Security);
}
url
},
Err(_) => return Err(Error::Security),
}
},
None => active_document.url().clone(),
};

if !UrlHelper::SameOrigin(&url, active_document.url()) {
return Err(Error::Security);
}

self.history.borrow_mut().push(SessionHistoryEntry::new(&*active_document,
url,
title,
@@ -222,7 +223,12 @@ impl BrowsingContext {
let url = match url {
Some(url) => {
match active_document.url().join(&url) {
Ok(url) => url,
Ok(url) => {
if !UrlHelper::SameOrigin(&url, active_document.url()) {
return Err(Error::Security);
}
url
},
Err(_) => return Err(Error::Security),
}
},
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.