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/18 18:22:16 UTC

[GitHub] [cordova-ios] msmtamburro opened a new issue #909: 404 when startpage contains a query string and protocol/scheme are specified

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


   # Bug Report
   
   ## Problem
   
   As soon as you specify a scheme / protocol in config.xml, even if you use the default, app://localhost, requests will then start to go through CDVURLSchemeHandler.m.  Here, they can pass through `[[NSData alloc] initWithContentsOfFile:startPath]` which returns `nil` if the startPage has a query string, resulting in a 404.
   
   ### What is expected to happen?
   
   The query string should be stripped before using `initWithContentsOfFile:`.  The file URL could be constructed with URL components instead of strings, so that it is possible to omit things like query strings safely.
   
   ### What does actually happen?
   
   `initWithContentsOfFile:` does not know what to do with the query string, so you get a 404.
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   Note: this possibly also fails with fragments... I did not test.  And, it might be helpful to document scheme and protocol so developers might understand why they would customize these.
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   1. set your startPage to `index.html?whoops`
   2. specify preferences in `config.xml` for `scheme` and `protocol`
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   iOS 13
   
   ### 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-ios 6.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:
users@infra.apache.org



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