Просмотр исходного кода

enhance: utils of safe path join

charlie 3 лет назад
Родитель
Сommit
13091b8781
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/main/frontend/utils.js

+ 2 - 1
src/main/frontend/utils.js

@@ -317,7 +317,8 @@ export const nodePath = Object.assign({}, path, {
 
     try {
       orURI = new URL(input)
-      input = input.replace(orURI.protocol, '')
+      input = input.replace(orURI.protocol + '//', '')
+        .replace(orURI.protocol, '')
         .replace(/^\/+/, '/')
     } catch (_e) {}