From: liwei Date: Fri, 21 Feb 2020 07:39:05 +0000 (+0800) Subject: [VD] Check file protocol using file format X-Git-Tag: submit/tizen_5.5/20200316.025242~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5af2070b874ae3b0fe90293af01f7dc1e8bf0c1;p=platform%2Fframework%2Fweb%2Fwrtjs.git [VD] Check file protocol using file format In current logic, WRT use url format to check file protocol, if file path including special character(ex. blank/?/+/...), it will be converted to special code(blank-> %20, #->%23,...), so we should use file format to check file exist or not. ex. /opt/media/USBDriveA1/bts/1/Fulfill%20mentGustav_Klimt.jpg we should change it to file format /opt/media/USBDriveA1/bts/1/Fulfill mentGustav_Klimt.jpg otherwise, this image can not be shown. Change-Id: I6f3fbc6304ab8ea501f7cd01aa5f05f16edd779a Signed-off-by: liwei --- diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js index 54290507..5cfafa0c 100755 --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -146,7 +146,7 @@ class WebApplication { protocol.interceptFileProtocol('file', (request, callback) => { if (request.url) { let access_path, parsed_info = new URL(request.url); - access_path = parsed_info.host + parsed_info.pathname; + access_path = parsed_info.host + decodeURI(parsed_info.pathname); console.log(`check path: : ${access_path}`); for (let p in self.accessiblePath) { if (access_path.startsWith(self.accessiblePath[p])) {