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


   # Bug Report
   We are busy reviewing our apps to get ready for iOS 15 changes. We have 
noticed when using a basic JS fetch and supplying custom headers the encounters 
an error. This is problematic especially if the the fetches require headers 
such as tokens, authorization ect.
   
   This appears to only occur when using the scheme and host name options.
   
   ```
   <preference name="scheme" value="http" />
   <preference name="hostname" value="localhost" />
   ```
   
   
   ## Problem
   **Web Error**
   `Failed to load resource: WebKit encountered an internal error`
   
   **XCode Error**
   ```
   [Process] 0x128ad1000 - NetworkProcessProxy::didClose (Network Process 0 
crash)
   [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain 
Code=2 "Specified target process does not exist" 
UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
   ```
   
   ### What is expected to happen?
   At least a success or catch error should return on the js fetch
   
   
   ### What does actually happen?
   Xcode returns a error and the fetch does not execute
   
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   We have tested a simple fetches, one without custom headers and one with 
custom headers.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   **What works**
   ```
   fetch(`https://everydaydigital.co.za/lab/tests/test.php`).then(r => {
        return r.json();
   }).then(response => {
        console.log(response);
   }).catch(err => {
        console.warn(err);
   });
   ```
   
   **What doesn't work**
   ```
   fetch(`https://everydaydigital.co.za/lab/tests/test.php`,{
       headers : {
           'token' : '123456789'
       }
   }).then(r => {
        return r.json();
   }).then(response => {
       console.log(response);
   }).catch(err => {
      console.warn(err);
   });
   ```
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   Mac OS
   XCode 13
   Simulator
   
   ### 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.
   -->
   Cordova 10.0
   Cordova iOS 6.2.0
   
   
   ## 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.

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