You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2022/05/18 04:37:00 UTC

[GitHub] [cordova-plugin-file-transfer] CodeWithOz opened a new issue, #334: images failing from whitelisted urls

CodeWithOz opened a new issue, #334:
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/334

   # Bug Report
   
   ## Problem
   I get a `401` error when I try to download images using the file-transfer plugin. My server doesn't return a `401` status at all, so it's not an issue with authentication on my server. I tracked down the code that's generating the `401` status to [this line of code](https://github.com/apache/cordova-plugin-file-transfer/blob/ec11d2fd0e87d7d9e0ba94b1989ffb71af1c3c96/src/android/FileTransfer.java#L698) that sends the `401` status if the url is not in the allow list for the app. The problem is that the url should match because its base is in the allow list. I have set the allow list to allow both full and wildcard matching of the base url, yet this problem continues to happen. These are my `access` tags for the base url:
   ```
       <access origin="https://cloud.dev.textras.com/*" />
       <access origin="https://*.dev.textras.com/*" />
       <access origin="https://*.textras.com/*" />
   ```
   And an example of an image url that's not getting downloaded is `https://cloud.dev.textras.com/v1/media/round?r=32&q=100&f=images/6151be6d02dbc700142308af/thumbnail.jpeg`. The image loads correctly in an `img` tag and in the browser.
   
   ### What is expected to happen?
   The image should be downloaded without problems.
   
   
   ### What does actually happen?
   Please see the problem description above
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   Please see the problem description above
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   N/A
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   From Android 8 to latest Android
   
   
   ### Version information
   <!--
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI 10, Cordova Android 10.1.0, Cordova Plugins
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   - Cordova CLI 10
   - Cordova Android 10.1.0
   - file transfer plugin at [commit `ec11d2fd0e87d7d9e0ba94b1989ffb71af1c3c96`](https://github.com/apache/cordova-plugin-file-transfer/commit/ec11d2fd0e87d7d9e0ba94b1989ffb71af1c3c96)
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org