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

URL contains extra slash while matching against filters and some rules are not applied #1338

Closed
AdamWr opened this issue Sep 10, 2020 · 4 comments

Comments

@AdamWr
Copy link
Member

AdamWr commented Sep 10, 2020

Steps to reproduce:

  1. Add these rules:
||example.org^$replace=/<h1>[\s\S]*?<\/h1>/<script src="path\/thisistest\/adv\.js"><\/script>/
/thisistest/*$domain=example.org
@@||example.org/path/thisistest/adv.js
  1. Go here - http://example.org/

Expected behavior

Request/script example.org/path/thisistest/adv.js shouldn't be blocked.

Actual behavior

It seems that request/script is removed, because there is added additional slash and it looks like that:
http://example.org//path/thisistest/adv.js

Screenshot when request is not blocked

image

Screenshot when request/script is blocked/removed

image

Additionally, I'm not sure if it's a bug, but it seems that exception with $content modifier disable $replace rules as well:
@@||example.org^$content

Your environment

  • AdGuard for Windows 7.5 nightly 25 (build 3382, CL 1.7.64)
@sxgunchenko
Copy link

Regarding $content modifier disabling $replace rules: it's intended behaviour, but according to spec it seems like a bug (or maybe the specification should be corrected)

@AdamWr
Copy link
Member Author

AdamWr commented Sep 10, 2020

Regarding $content modifier disabling $replace rules: it's intended behaviour

Yes, it's in specification, but I missed it https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#disabling-replace-rules
Thank you for your answer.

@sxgunchenko
Copy link

Oh, and I missed that it is specified in the $replace section. :)

@ameshkov
Copy link
Member

Huh, inventive way of reproducing the issue

@adguard-bot adguard-bot changed the title Sometimes there is additional slash in blocked requests Sometimes path combining helper puts extra slash Sep 10, 2020
@sfionov sfionov changed the title Sometimes path combining helper puts extra slash URL contains extra slash while matching against filters and some rules are not applied Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants