Skip to content

Commit 1ca3bfb

Browse files
authored
docs: fix ReferenceError in open-redirect example (Url -> URL) (#2465)
1 parent a678b48 commit 1ca3bfb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/content/pages/en/advanced/best-practice-security.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Here is an example of checking URLs before using `res.redirect` or `res.location
6464
```js
6565
app.use((req, res) => {
6666
try {
67-
if (new Url(req.query.url).host !== 'example.com') {
67+
if (new URL(req.query.url).host !== 'example.com') {
6868
return res.status(400).end(`Unsupported redirect to host: ${req.query.url}`);
6969
}
7070
} catch (e) {

0 commit comments

Comments
 (0)