We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bab752d commit 4560bc5Copy full SHA for 4560bc5
doc/api/url.md
@@ -1853,7 +1853,7 @@ input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
1853
function getURL(req) {
1854
const proto = req.headers['x-forwarded-proto'] || 'https';
1855
const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
1856
- return new URL(req.url || '/', `${proto}://${host}`);
+ return new URL(`${proto}://${host}${req.url || '/'}`);
1857
}
1858
```
1859
@@ -1863,7 +1863,7 @@ use the example below:
1863
1864
```js
1865
1866
- return new URL(req.url || '/', 'https://example.com');
+ return new URL(`https://example.com${req.url || '/'}`);
1867
1868
1869
0 commit comments