| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent beadcf1 commit 70c2080
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1847,7 +1847,7 @@ input. CVEs are not issued for `url.parse()` vulnerabilities. Use the | |||
| 1847 | 1847 | function getURL(req) { | |
| 1848 | 1848 | const proto = req.headers['x-forwarded-proto'] || 'https'; | |
| 1849 | 1849 | const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com'; | |
| 1850 | - return new URL(req.url || '/', `${proto}://${host}`); | ||
| 1850 | + return new URL(`${proto}://${host}${req.url || '/'}`); | ||
| 1851 | 1851 | } | |
| 1852 | 1852 | ``` | |
| 1853 | 1853 | ||
@@ -1857,7 +1857,7 @@ use the example below: | |||
| 1857 | 1857 | ||
| 1858 | 1858 | ```js | |
| 1859 | 1859 | function getURL(req) { | |
| 1860 | - return new URL(req.url || '/', 'https://example.com'); | ||
| 1860 | + return new URL(`https://example.com${req.url || '/'}`); | ||
| 1861 | 1861 | } | |
| 1862 | 1862 | ``` | |
| 1863 | 1863 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments