Page MenuHomePhabricator
Paste P7816

url parsing in nodejs with no scheme
ActivePublic

Authored by BBlack on Nov 16 2018, 1:51 PM.
Tags
None
Referenced Files
F27239790: url parsing in nodejs with no scheme
Nov 16 2018, 1:53 PM
F27239788: url parsing in nodejs with no scheme
Nov 16 2018, 1:53 PM
F27239782: url parsing in nodejs with no scheme
Nov 16 2018, 1:51 PM
Subscribers
None
request library ends up passing whatever's in the HTTPS_PROXY env var to url.parse(), and thus:
$ nodejs -e "require('url'); console.log(url.parse('208.80.154.22:8080'))"
Url {
protocol: '208.80.154.22:',
slashes: null,
auth: null,
host: '8080',
port: null,
hostname: '8080',
hash: null,
search: null,
query: null,
pathname: null,
path: null,
href: '208.80.154.22:8080' }
And then the decimal integer "8080", interpreted as a 32-bit integer IP, would be 0.0.31.144 ...

Event Timeline

BBlack edited the content of this paste. (Show Details)
BBlack edited the content of this paste. (Show Details)