[Privoxy-users] forward-override based on user-agent tag does opposite of what it should

Fabian Keil fk at fabiankeil.de
Fri Oct 27 17:21:06 CEST 2023


Synan B <rsbernt at gmail.com> wrote on 2023-10-25 at 13:10:19:

> FOLLOW-UP QUESTION:
> Is there a way to search for a specific string (like grep/regex) in the 
> User Agent TAG with the PCRE language Privoxy uses, so that the 
> forwarded UA is not nonsensical and is also not hard-coded? Something
> like: TAG:^User-Agent: |/\b(|^User-Agent|||||AppleWebKit|)\b/|

It's not obvious to me what the TAG: above is supposed to match,
especially the "|||||" part seems weird.

In general you can match User-Agent headers with certain
strings with a TAG: line like:

TAG:^User-Agent:.*FreeBSD

While you can also look for multiple strings with groupings
like "(aaa|bbb)" you can simply use multiple TAG lines instead.

> I probably need to create a special filter for this to work?

Filters are used to modify content oder headers so I'm not
sure why you think you need them here.

I would recommend that you only send User-Agent headers that
look valid in which case there shouldn't be any need to rewrite
them.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-users/attachments/20231027/0c036e99/attachment.bin>


More information about the Privoxy-users mailing list