rolinger opened a new issue, #1297:
URL: https://github.com/apache/cordova-ios/issues/1297

   # Bug Report
   on iOS, <img ng-src="https://example.com/file/someImage.png";>, the call to 
the server is not passing the `Origin` header at all.
   
   ## Problem
   Stated above.  This issue is different but is quite similar to this one: 
https://github.com/apache/cordova-ios/issues/897 - the difference between these 
two issues is in that issue it appears `Origin` is passed with a null value, 
whereas this issue is about `Origin` is not passed at all.
   
   ### What is expected to happen?
   The `Origin` as defined in `config.xml` preference is set and passed in 
`<img ng-src>` url calls
   
   
   ### What does actually happen?
   
   In an html template: `<img ng-src="https://example.com/image.png";>` - the 
url call does not include any headers such as Origin and Referrer. On Android, 
both are passed in the headers.
   
   However `<ng-include src="https://example.com/thisFile.txt";>` does pass the 
Origin header. Android passes both Origin and Referrer
   
   Because the Origin header is required on our server, all server images being 
loaded in our app on iOS are being blocked forcing us to rewrite all standard 
`<img ng-src="{{imageUrl}}">` calls to retrieve the image via `$http.get()` 
like:
   
   ```
   <img data-ng-src="{{someImage}}" ng-init="getImage(imageUrl)">
   
   $scope.getImage = function(url) {
      $http.get(url).then(function(response) {
         $scope.someImage = response.data ;
     }) ;
   }
   ```
   
   We don't have to add any additional headers because on iOS `$http.get` 
natively adds the `Origin` header. On Android, it adds `Origin and Referrer`. 
This is not ideal; besides having to rewrite tons of `<img>` tags the file 
loads are slower. We are also coming through the rest of our code to to look 
for any other type of `src` call and having to test what that call looks like. 
If others are doing the same as the `<img ng-src>` then we will have to rewrite 
those too.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to