Menu

#1657 SERVER/CLIENT-HEADER-TAGGER should run after SERVER/CLIENT-HEADER-FILTER

3.0.21
open
nobody
None
7
2014-07-09
2014-06-29
Cattleya
No

I think better if SERVER/CLIENT-HEADER-TAGGER should run after SERVER/CLIENT-HEADER-FILTER, so we can do something like block by score with ease, I finally found an idea how to do that:

URL to test: http://example.com/ad1/ad2/ad3/

First create a new header URL with $url variable

CLIENT-HEADER-FILTER: blockbyscore1
s@^Host.*$@$0\r\nURL: http://example.com/ad1/ad2/ad3/@giD
s@URL:.*ad1.*@$0S@i
s@URL:.*ad2.*@$0S@i
s@URL:.*ad3.*@$0S@i

{+client-header-filter{blockbyscore1}}
/

And check if URL header have ad1, ad2, ad3 and if match then add S at the last of the header, the header will become something like that:

URL: http://example.com/ad1/ad2/ad3/SSS

And then check if URL have SSS or not, if match then tag it

SERVER-HEADER-TAGGER: blockbyscore2
s@URL:.*(SSS).*@$1@i

{+client-header-tagger{blockbyscore2}}
/

So after that action we will have this TAG:
TAG:SSS

Ok, now just check if tag have SSS or not, if match then block request.
`{+block{blockbyscore3}}
TAG:SSS

But problem that Privoxy always TAG first, CLIENT-HEADER-FILTER, so it is impossible at this time, If there will be a change in the future then I think we can do something like that, but I think it worth if it don't break backward compatibility (break old filters, break some tricks).

Discussion

  • Cattleya

    Cattleya - 2014-06-29

    Sorry, I wrong typed, must be
    CLIENT-HEADER-TAGGER: blockbyscore2

    instead SERVER.

     
  • Cattleya

    Cattleya - 2014-07-09

    Sorry, I posted at wrong place, please move this thread to Feature Requests: https://sourceforge.net/p/ijbswa/feature-requests/

     

Log in to post a comment.