-
Notifications
You must be signed in to change notification settings - Fork 758
Open
Description
Bug Report
If I try to resolve something like http://localhost:8000/index.html
i get an ENCODING_ERR
because of these lines:
cordova-plugin-file/www/resolveLocalFileSystemURI.js
Lines 55 to 62 in 3e58876
// sanity check for 'not:valid:filename' or '/not:valid:filename' | |
// file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /. | |
if (!uri || uri.split(':').length > 2) { | |
setTimeout(function () { | |
fail(FileError.ENCODING_ERR); | |
}, 0); | |
return; | |
} |
When i disable this code like i did here GitToTheHub#1, I can finally resolve urls like http://localhost:8000/index.html
. Do someone know why these lines of code exist and if it's safe to remove them? I would make an PR without these lines, or by allowing maximum 2 colons.
Problem
What is expected to happen?
URLs like http://localhost:8000/index.html
should resolve
What does actually happen?
The API throws ENCODING_ERR
Information
Just run the app in a browser and try to resolve http://localhost:8000/index.html
.
Command or Code
resolveLocalFileSystemURL(
"http://localhost:8000/index.html",
(fileEntry) => {
alert("URL successfully resolved! name=" + fileEntry.name);
},
(fileError) => {
alert("URL could not be resolved: " + fileError.code);
}
);
(Something to note: When i try to resolve a wrong url with my changed code, to allow more than one colon, the errorcallback will not be invoked)
Environment, Platform, Device
Browser platform, but this issue will occure in any other platform also.
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Metadata
Metadata
Assignees
Labels
No labels