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 3b3b71e commit 1ddaab1Copy full SHA for 1ddaab1
doc/api/url.md
@@ -1716,6 +1716,16 @@ and incorrect handling of usernames and passwords. Do not use with untrusted
1716
input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
1717
[WHATWG URL][] API instead.
1718
1719
+The example above assumes well-formed headers are forwarded from a reverse
1720
+proxy to your Node.js server. If you are not using a reverse proxy, you should
1721
+use the example below:
1722
+
1723
+```js
1724
+function getURL(req) {
1725
+ return new URL(req.url || '/', 'https://example.com');
1726
+}
1727
+```
1728
1729
### `url.resolve(from, to)`
1730
1731
<!-- YAML
0 commit comments