diff --git a/package.json b/package.json index 4f5f8b22..32081fbd 100644 --- a/package.json +++ b/package.json @@ -118,5 +118,8 @@ "hooks": { "pre-commit": "lint-staged" } + }, + "engines": { + "node": ">=10.15.3" } } diff --git a/src/lambda/oembed/oembed.js b/src/lambda/oembed/oembed.js index f7bcf9ce..02aea8d1 100644 --- a/src/lambda/oembed/oembed.js +++ b/src/lambda/oembed/oembed.js @@ -1,5 +1,3 @@ -const URL = require('url'); - function incorrectParams(error) { return { statusCode: 501, // oembed status // 422, // Unprocessable Entity @@ -40,7 +38,7 @@ function handler(event, context, callback) { ); } - const { hostname, pathname } = URL.parse(params.url); + const { hostname, pathname } = new URL(params.url); // verify if the url is supported, basically we only allow localhost if we're // running at localhost, and testing-playground.com as host. And either no