Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ddaab1

Browse filesBrowse files
styfleaduh95
authored andcommitted
doc: mention reverse proxy and include simple example
PR-URL: #59736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 3b3b71e commit 1ddaab1
Copy full SHA for 1ddaab1

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/url.md‎

Copy file name to clipboardExpand all lines: doc/api/url.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,16 @@ and incorrect handling of usernames and passwords. Do not use with untrusted
17161716
input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
17171717
[WHATWG URL][] API instead.
17181718

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+
17191729
### `url.resolve(from, to)`
17201730

17211731
<!-- YAML

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.