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

Implement checks on Location setters #23670

Closed
wants to merge 6 commits into from

pathname: terminate if cannot-be-a-base

  • Loading branch information
braddunbar committed Jun 30, 2019
commit 3f2abccd01b4595ce47dd71c460b1ee52644f5d2
@@ -197,7 +197,10 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn SetPathname(&self, value: USVString) -> ErrorResult {
self.check_same_origin_domain()?;
self.set_url_component(value, UrlHelper::SetPathname);
// If copyURL's cannot-be-a-base-URL flag is set, terminate these steps.
if !self.get_url().cannot_be_a_base() {
self.set_url_component(value, UrlHelper::SetPathname);
}
Ok(())
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.