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

Cosmetic filtering cannot resolve relative URLs as first-party #30062

Closed
antonok-edm opened this issue Apr 28, 2023 · 0 comments · Fixed by brave/brave-core#18305
Closed

Cosmetic filtering cannot resolve relative URLs as first-party #30062

antonok-edm opened this issue Apr 28, 2023 · 0 comments · Fixed by brave/brave-core#18305
Assignees
Labels

Comments

@antonok-edm
Copy link
Collaborator

CosmeticFiltersJSHandler::OnIsFirstParty contains the following code:

  const auto url = GURL(url_string);
  if (!url.is_valid())
    return false;

This doesn't work when url_string is a relative URL, which always results in an invalid constructed URL. Instead, we should use url_.Resolve(url_string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants