Remove "X-Requested-With"

When any app uses Android’s WebView to load a web page, WebView attaches an extra header, named X-Requested-With, with the value set to the application ID. 
That include Lightning-I2P browser by R4SAS. 
Google doesn’t want to make it easy to get rid of the X-Requested-With header. However, there is a mechanism for replacing header information. This doesn’t allow a program to stop sending the X-Requested-With header.

More info on: https://www.stoutner.com/the-x-requested-with-header/
This commit is contained in:
Jigen 2022-12-02 16:09:23 +00:00 committed by GitHub
parent eb0ef80a17
commit 519c0fe81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,6 +252,7 @@ namespace proxy {
req.RemoveHeader("From"); req.RemoveHeader("From");
req.RemoveHeader("Forwarded"); req.RemoveHeader("Forwarded");
req.RemoveHeader("DNT"); // Useless DoNotTrack flag req.RemoveHeader("DNT"); // Useless DoNotTrack flag
req.RemoveHeader("X-Requested-With"); // Android Webview send this with the value set to the application ID
req.RemoveHeader("Accept", "Accept-Encoding"); // Accept*, but Accept-Encoding req.RemoveHeader("Accept", "Accept-Encoding"); // Accept*, but Accept-Encoding
/* drop proxy-disclosing headers */ /* drop proxy-disclosing headers */
req.RemoveHeader("X-Forwarded"); req.RemoveHeader("X-Forwarded");