Skip to content

Commit 0dd614c

Browse files
chore: use global URL instead of import (#291)
1 parent 1e4993f commit 0dd614c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,8 @@
118118
"hooks": {
119119
"pre-commit": "lint-staged"
120120
}
121+
},
122+
"engines": {
123+
"node": ">=10.15.3"
121124
}
122125
}

src/lambda/oembed/oembed.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const URL = require('url');
2-
31
function incorrectParams(error) {
42
return {
53
statusCode: 501, // oembed status // 422, // Unprocessable Entity
@@ -40,7 +38,7 @@ function handler(event, context, callback) {
4038
);
4139
}
4240

43-
const { hostname, pathname } = URL.parse(params.url);
41+
const { hostname, pathname } = new URL(params.url);
4442

4543
// verify if the url is supported, basically we only allow localhost if we're
4644
// running at localhost, and testing-playground.com as host. And either no

0 commit comments

Comments
 (0)