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
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
set your startPage to index.html?whoops
specify preferences in config.xml for scheme and protocol
Environment, Platform, Device
iOS 13
Version information
cordova-ios 6.0
Checklist
[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
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 returnsnil
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
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
index.html?whoops
config.xml
forscheme
andprotocol
Environment, Platform, Device
iOS 13
Version information
cordova-ios 6.0
Checklist