Page MenuHomePhabricator

url parsing in nodejs with no scheme

Authored By
BBlack
Nov 16 2018, 1:51 PM
Size
491 B
Referenced Files
None
Subscribers
None

url parsing in nodejs with no scheme

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.15422:8080'))"
Url {
protocol: '208.80.15422:',
slashes: null,
auth: null,
host: '8080',
port: null,
hostname: '8080',
hash: null,
search: null,
query: null,
pathname: null,
path: null,
href: '208.80.15422:8080' }
And then the decimal integer "8080", interpreted as a 32-bit integer IP, would be 0.0.31.144 ...

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6702218
Default Alt Text
url parsing in nodejs with no scheme (491 B)

Event Timeline