oracle / cordova-plugin-wkwebview-file-xhr

Cordova Plugin for WebView File XHR
Universal Permissive License v1.0
138 stars 120 forks source link

Spaces in url's gives issues #63

Closed Ruud-cb closed 3 years ago

Ruud-cb commented 4 years ago

Hi, We have a lot of svg's that, unfortunately, contain spaces in there file names (loaded from external packages). This results in 404 not found errors. In this section I added some code https://github.com/oracle/cordova-plugin-wkwebview-file-xhr/blob/master/src/ios/CDVWKWebViewFileXhr.m#L132

    uri = [uri stringByReplacingOccurrencesOfString:@" "
                                    withString:@"%20"];

Perhaps you want to add this and some other modifications.

manish2788 commented 3 years ago

I would recommend you to use encodeURI api in javascript to handle filename with spaces.