diff --git a/lib/Page.js b/lib/Page.js index fee342580bf..5051addb475 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -687,7 +687,7 @@ class Page extends EventEmitter { console.assert(options.type === 'png' || options.type === 'jpeg', 'Unknown options.type value: ' + options.type); screenshotType = options.type; } else if (options.path) { - const mimeType = mime.lookup(options.path); + const mimeType = mime.getType(options.path); if (mimeType === 'image/png') screenshotType = 'png'; else if (mimeType === 'image/jpeg') diff --git a/package.json b/package.json index 41793b71609..83e27234793 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,10 @@ "author": "The Chromium Authors", "license": "Apache-2.0", "dependencies": { - "debug": "^2.6.8", + "debug": "^3.1.0", "extract-zip": "^1.6.5", "https-proxy-agent": "^2.1.0", - "mime": "^1.3.4", + "mime": "^2.0.3", "progress": "^2.0.0", "proxy-from-env": "^1.0.0", "rimraf": "^2.6.1", @@ -41,7 +41,7 @@ "devDependencies": { "@types/debug": "0.0.30", "@types/extract-zip": "^1.6.2", - "@types/mime": "^1.3.1", + "@types/mime": "^2.0.0", "@types/node": "^8.0.26", "@types/rimraf": "^2.0.2", "@types/ws": "^3.0.2", diff --git a/test/golden-utils.js b/test/golden-utils.js index bfa3d266ab8..158139865ba 100644 --- a/test/golden-utils.js +++ b/test/golden-utils.js @@ -93,11 +93,11 @@ function compare(goldenPath, outputPath, actual, goldenName) { }; } const expected = fs.readFileSync(expectedPath); - const comparator = GoldenComparators[mime.lookup(goldenName)]; + const comparator = GoldenComparators[mime.getType(goldenName)]; if (!comparator) { return { pass: false, - message: 'Failed to find comparator with type ' + mime.lookup(goldenName) + ': ' + goldenName + message: 'Failed to find comparator with type ' + mime.getType(goldenName) + ': ' + goldenName }; } const result = comparator(actual, expected); diff --git a/test/server/SimpleServer.js b/test/server/SimpleServer.js index 9825d69dc4e..473ed61475b 100644 --- a/test/server/SimpleServer.js +++ b/test/server/SimpleServer.js @@ -234,7 +234,7 @@ class SimpleServer { response.end(`File not found: ${filePath}`); return; } - response.setHeader('Content-Type', mime.lookup(filePath)); + response.setHeader('Content-Type', mime.getType(filePath)); response.end(data); }); }