@@ -45,7 +45,6 @@ Licensed to the Apache Software Foundation (ASF) under one
45
45
import org .apache .cordova .LOG ;
46
46
import org .apache .cordova .PluginManager ;
47
47
import org .apache .cordova .PluginResult ;
48
- import org .apache .cordova .Whitelist ;
49
48
import org .apache .cordova .file .FileUtils ;
50
49
import org .json .JSONArray ;
51
50
import org .json .JSONException ;
@@ -676,25 +675,11 @@ private void download(final String source, final String target, JSONArray args,
676
675
return ;
677
676
}
678
677
679
- /* This code exists for compatibility between 3.x and 4.x versions of Cordova.
680
- * Previously the CordovaWebView class had a method, getWhitelist, which would
681
- * return a Whitelist object. Since the fixed whitelist is removed in Cordova 4.x,
682
- * the correct call now is to shouldAllowRequest from the plugin manager.
683
- */
684
678
Boolean shouldAllowRequest = null ;
685
679
if (isLocalTransfer ) {
686
680
shouldAllowRequest = true ;
687
681
}
688
- if (shouldAllowRequest == null ) {
689
- try {
690
- Method gwl = webView .getClass ().getMethod ("getWhitelist" );
691
- Whitelist whitelist = (Whitelist )gwl .invoke (webView );
692
- shouldAllowRequest = whitelist .isUrlWhiteListed (source );
693
- } catch (NoSuchMethodException e ) {
694
- } catch (IllegalAccessException e ) {
695
- } catch (InvocationTargetException e ) {
696
- }
697
- }
682
+
698
683
if (shouldAllowRequest == null ) {
699
684
try {
700
685
Method gpm = webView .getClass ().getMethod ("getPluginManager" );
@@ -708,13 +693,12 @@ private void download(final String source, final String target, JSONArray args,
708
693
}
709
694
710
695
if (!Boolean .TRUE .equals (shouldAllowRequest )) {
711
- LOG .w (LOG_TAG , "Source URL is not in white list : '" + source + "'" );
696
+ LOG .w (LOG_TAG , "The Source URL is not in the Allow List : '" + source + "'" );
712
697
JSONObject error = createFileTransferError (CONNECTION_ERR , source , target , null , 401 , null );
713
698
callbackContext .sendPluginResult (new PluginResult (PluginResult .Status .IO_EXCEPTION , error ));
714
699
return ;
715
700
}
716
701
717
-
718
702
final RequestContext context = new RequestContext (source , target , callbackContext );
719
703
synchronized (activeRequests ) {
720
704
activeRequests .put (objectId , context );
0 commit comments