Paste P7816

url parsing in nodejs with no scheme
ActivePublic

Authored by BBlack on Fri, Nov 16, 1:51 PM.
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 ...
BBlack created this paste.Fri, Nov 16, 1:51 PM
BBlack edited the content of this paste. (Show Details)
BBlack edited the content of this paste. (Show Details)