chore: Use file name sanitizer imported from appium-support
MODIFY
lib/basedriver/helpers.js
lib/basedriver/helpers.js
@@ -9,7 +9,6 @@ import request from 'request';
import asyncRequest from 'request-promise';
import LRU from 'lru-cache';
import AsyncLock from 'async-lock';
-import sanitize from 'sanitize-filename';
const ZIP_EXTS = ['.zip', '.ipa'];
@@ -130,7 +129,7 @@ async function configureApp (app, supportedAppExtensions) {
}
let fileName = null;
- const basename = sanitize(path.basename(decodeURIComponent(pathname)), {
+ const basename = fs.sanitizeName(path.basename(decodeURIComponent(pathname)), {
replacement: SANITIZE_REPLACEMENT
});
const extname = path.extname(basename);
@@ -155,7 +154,7 @@ async function configureApp (app, supportedAppExtensions) {
logger.debug(`Content-Disposition: ${headers['content-disposition']}`);
const match = /filename="([^"]+)/i.exec(headers['content-disposition']);
if (match) {
- fileName = sanitize(match[1], {
+ fileName = fs.sanitizeName(match[1], {
replacement: SANITIZE_REPLACEMENT
});
shouldUnzipApp = shouldUnzipApp || ZIP_EXTS.includes(path.extname(fileName));

MODIFY
package.json
package.json
],
"dependencies": {
"@babel/runtime": "^7.0.0",
- "appium-support": "^2.41.0",
+ "appium-support": "^2.42.0",
"async-lock": "^1.0.0",
"asyncbox": "^2.3.1",
"bluebird": "^3.5.3",
"morgan": "^1.9.0",
"request": "^2.83.0",
"request-promise": "^4.2.2",
- "sanitize-filename": "^1.6.1",
"serve-favicon": "^2.4.5",
"source-map-support": "^0.5.5",
"validate.js": "^0.13.0",

chore: Use file name sanitizer imported from appium-support (#394)