Browse Source

Force add extra headers - referer

Tang Nguyen 4 years ago
parent
commit
29d8f35e54

+ 4
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

@@ -609,7 +609,10 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
609 609
         if (args == null) {
610 610
           throw new RuntimeException("Arguments for loading an url are null!");
611 611
         }
612
-        root.loadUrl(args.getString(0));
612
+        HashMap<String, String> headerMap = new HashMap<>();
613
+        headerMap.put("referer", root.getUrl());
614
+        
615
+        root.loadUrl(args.getString(0), headerMap);
613 616
         break;
614 617
       case COMMAND_FOCUS:
615 618
         root.requestFocus();