Re: forward-override based on user-agent tag does opposite of what it should

Fabian Keil <[email protected]> Fri, 27 Oct 2023 17:21:06 +0200
Newsgroups gmane.comp.web.privoxy.user
Message-ID <[email protected]>
--===============6373308756497160907==
Content-Type: multipart/signed; boundary="Sig_/pwsXgj3/Uqhnzlsjj3kbDxl";
 protocol="application/pgp-signature"; micalg=pgp-sha256

--Sig_/pwsXgj3/Uqhnzlsjj3kbDxl
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Synan B <[email protected]> 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=20
> User Agent TAG with the PCRE language Privoxy uses, so that the=20
> 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

--Sig_/pwsXgj3/Uqhnzlsjj3kbDxl
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEETzbBfzgWkTZUoehQaRgikYuiNxwFAmU71WIACgkQaRgikYui
NxxPZg//QBGu3eRaxvNQURfEs/HPJ3JxBBQqbNiFP691b+PtTYfKaiCJTojmJTl2
mNeysA+G8wwV0sh0nGN2CMtAxzLJ15xLA9MIE/a+RfcINhictf22k3QKNs96gwlC
/UjvvVFqDwQrs9O1b+igR3BeEGkGIYftnRvI2r7AeS7Hc2gLUxYTVXzQFrD7X1QM
8o4ukj23aBrIis4FtMjG2aol6KuayenjMM82ij6EmubkjKhgsxawqzaoKS/C5g6k
zR0IfMQQ7B18sytKlItOZxhnBFJXKZRvGSHOE2i5stJog2GxWR1GuIGSkYFone+C
Ls4bkhWR33w1rv2poyJm3/kz6Y6Cfblr7rEuR266Tm16I2tK6wjM2cuD8M7DwiNA
2RY4cdRR69Ny5RN+tyhXgOv4dbwRwGxCCfYgfFHiZt2gf5aMiNaCxZZH4/dbiPqu
lluknjypuOt6XWaYCUm6cP8seHYaKXUR6mPKnFDizhOBGI/+kVmILiaIOpygdfOL
UgAM9NcXD5A5xDeB7QajVQcvhEsaVEYaWyjQsVOjLpv8sHNUQ44PGGcmXhRd+wZ6
rcfY7SLU/QQIxEs5vM8HzbrN1BKY33YqVihDvRIoa7K39utuH7KWG/dZ2wK5BCDZ
gYCLh8l5tfpIwS1b6Fm3Q/zmf449VzJxAvJGXiYpBz/Umi0phtI=
=PHAE
-----END PGP SIGNATURE-----

--Sig_/pwsXgj3/Uqhnzlsjj3kbDxl--

--===============6373308756497160907==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Privoxy-users mailing list
[email protected]
https://lists.privoxy.org/mailman/listinfo/privoxy-users

--===============6373308756497160907==--