[Service][AppManifest] Fix start url concatination 91/261391/2 submit/tizen/20210719.160022
authorDongHyun Song <dh81.song@samsung.com>
Fri, 16 Jul 2021 08:56:04 +0000 (17:56 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Mon, 19 Jul 2021 00:53:52 +0000 (09:53 +0900)
Make correct URL with relative path.

Change-Id: I27a96c40e21d5b0fb6393b224e0414f542514546
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/service/builtins/appmanifest_loader.ts

index dbf6bbf..c143a5d 100644 (file)
@@ -1,6 +1,7 @@
 import '../../common/init';
 import { isMainThread, workerData } from 'worker_threads';
 import { wrt } from '../../browser/wrt';
+import { URL } from 'url';
 import * as fs from 'fs';
 import * as https from 'https';
 import * as XWalkExtension from '../../common/wrt_xwalk_extension';
@@ -52,7 +53,8 @@ function makeFileSync(file: string, data: string) {
 
 function concatWithBaseUrl(path: string, baseUrl: string) {
   if (path.substr(0, 1) === '/') {
-    return baseUrl.substr(0, baseUrl.indexOf('/') + 1) + path;
+    const url = new URL(path, baseUrl);
+    return url.toString();
   } else if (path.indexOf('http:') == -1 && path.indexOf('https:') == -1) {
     return baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1) + path;
   }