[VD] Check file protocol using file format 78/225878/1 accepted/tizen/unified/20200302.080218 submit/tizen/20200227.003055 submit/tizen/20200228.052523 submit/tizen/20200302.024624
authorliwei <wei90727.li@samsung.com>
Tue, 25 Feb 2020 06:30:45 +0000 (14:30 +0800)
committerliwei <wei90727.li@samsung.com>
Tue, 25 Feb 2020 06:30:45 +0000 (14:30 +0800)
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: If159c68d74f12d4a68b8cacf182e3c4f75f4ad3b
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/src/web_application.js [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 5429050..5cfafa0
@@ -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])) {