Skip to content

url.resolveObject: conflicting values of host and port #8213

Closed
@imyller

Description

@imyller
  • Version: v6.4.0
  • Platform: Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
  • Subsystem: url

url.resolveObject generates inconsistent port and host value when modifying port:

$ node
> url.resolveObject('http://example.com:81', 'http://example.com:82');
Url {
  protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'example.com:82',
  port: '81',
  hostname: 'example.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/',
  path: '/',
  href: 'http://example.com:82/' }
> 

Where port and host unexpectedly contain conflicting information:

  host: 'example.com:82',
  port: '81',

Metadata

Metadata

Assignees

No one assigned

    Labels

    urlIssues and PRs related to the legacy built-in url module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions