You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/11 15:37:19 UTC

[GitHub] [cordova-ios] StaymanHou opened a new issue #897: origin is null for requests sent with window.fetch on WKWebView engine

StaymanHou opened a new issue #897:
URL: https://github.com/apache/cordova-ios/issues/897


   ### Issue Type
   - [ ] Bug Report
   - [ ] Feature Request
   - [x] Support Question
   
   ## Description
   I'm attempting to upgrade cordova-ios from 5.1.1 to 6.0.0 for a project. At the same time, I'm also trying to migrate from uiwebview to wkwebview since that's the new default. And uiwebview is going to be deprecated anyways.
   
   Following the release note, I've managed to get the standard xhr working by setting the `scheme` and `hostname` preferences in config.xml
   
   However the requests sent with window.fetch still have the origin set to null despite the custom scheme configuration.
   
   Is that the expected behavior, and I will have to migrate to some other plugin to replace the window.fetch functionality? Is there something else that I'm missing?
   


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] jony89 edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162


   same problem here with axios as well.
   
   ```Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```
   
   Not reproduced with cordova-ios 5.1.1 
   
   Occurs only with cordova-ios v > 6


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] 75341704 commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
75341704 commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-651287210


   Same problem when the axios is used. 
   


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] sams4465 commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
sams4465 commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-716964361


   in `CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m`
   after `WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];`
   add `[configuration setValue:@"TRUE" forKey:@"allowUniversalAccessFromFileURLs"];`
   can fix api fail
   
   


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] gaollard commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
gaollard commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-723414964


   Same problem when the axios is used.


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] adipascu commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
adipascu commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-962163107






-- 
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: issues-unsubscribe@cordova.apache.org

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



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


[GitHub] [cordova-ios] jony89 edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162






----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] StaymanHou commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
StaymanHou commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-643244312


   Managed to workaround that by using https://github.com/aporat/cordova-plugin-fetch
   
   Still would love to figure out the cause when get a chance, but the fetch plugin by @aporat would do it for now.


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] jony89 edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162


   same problem here with axios as well, occurs only with cordova-ios v > 6:
   
   ```Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```
   
   Not reproduced with cordova-ios 5.1.1, the `origin` header does not appear at all in the request.
   


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] breautek removed a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
breautek removed a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-642758281


   > Following the release note, I've managed to get the standard xhr working by setting the scheme and hostname preferences in config.xml
   
   It's my understanding that this should have done the trick. Can you maybe test the `XMLHttpRequest` method instead of `fetch`?


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] breautek commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-642760159


   This sounds like a wkwebview issue if it works with standard `XMLHttpRequest` but not with `fetch`.


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] jony89 commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162


   same problem here with axios as well.
   
   ```Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] breautek commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-642775153


   My wild guess is wkwebview is treating the request as a tainted origin, which I believe only does this on the `fetch` api. If the origin is considered tainted, then the origin becomes null, according to the Fetch spec.
   
   https://fetch.spec.whatwg.org/#serializing-a-request-origin


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] adipascu edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
adipascu edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-962163107






-- 
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: issues-unsubscribe@cordova.apache.org

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



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


[GitHub] [cordova-ios] breautek commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-642758281


   > Following the release note, I've managed to get the standard xhr working by setting the scheme and hostname preferences in config.xml
   
   It's my understanding that this should have done the trick. Can you maybe test the `XMLHttpRequest` method instead of `fetch`?


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] jony89 commented on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 commented on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162


   same problem here with axios as well.
   
   ```Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] breautek edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-642775153


   My wild guess is wkwebview is treating the request as a tainted origin, which I believe only does this on the `fetch` api. If the origin is considered tainted, then the origin becomes null, according to the Fetch spec.
   
   https://fetch.spec.whatwg.org/#serializing-a-request-origin
   
   But I don't know what qualifies as a tainted origin...


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-ios] jony89 edited a comment on issue #897: origin is null for requests sent with window.fetch on WKWebView engine

Posted by GitBox <gi...@apache.org>.
jony89 edited a comment on issue #897:
URL: https://github.com/apache/cordova-ios/issues/897#issuecomment-696870162


   same problem here with axios as well, occurs only with cordova-ios v > 6:
   
   ```Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.```
   
   Not reproduced with cordova-ios 5.1.1, this header does not appear at all in the request.
   


----------------------------------------------------------------
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.

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



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