Skip to content

Commit

Permalink
Change to SystemWebView.java to suppress at least one X-Requested-With (
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanShaak authored and pocmo committed Nov 17, 2017
1 parent 526b9cc commit dadc85e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
import org.mozilla.focus.web.IWebView;
import org.mozilla.focus.web.WebViewProvider;

import java.util.HashMap;
import java.util.Map;

public class SystemWebView extends NestedWebView implements IWebView, SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = "WebkitView";

Expand Down Expand Up @@ -160,7 +163,10 @@ public void loadUrl(String url) {
// called by webview when clicking on a link, and not when opening a new page for the
// first time using loadUrl().
if (!client.shouldOverrideUrlLoading(this, url)) {
super.loadUrl(url);
final Map<String, String> additionalHeaders = new HashMap<>();
additionalHeaders.put("X-Requested-With", "");

super.loadUrl(url, additionalHeaders);
}

client.notifyCurrentURL(url);
Expand Down

0 comments on commit dadc85e

Please sign in to comment.