Skip to content

url.resolve auth behavior if host does *not* change #8165

Closed
@msakrejda

Description

@msakrejda

#1480 was noted as a breaking change in node 6, but it looks like this also strips out auth information for cases where the host does not change:

maciek@mothra:~$ n 5.12
maciek@mothra:~$ <<<"console.log(require('url').resolve('https://user:password@example.com', 'https://example.com/foo'))" node
https://user:password@example.com/foo
maciek@mothra:~$ n 6.3.1
maciek@mothra:~$ <<<"console.log(require('url').resolve('https://user:password@example.com', 'https://example.com/foo'))" node
https://example.com/foo

As far as I can tell, these cases are not covered by the tests, so I'm not sure if this change is intentional, and it seems heavy-handed if so. This seems to be responsible for the issue I ran into in follow-redirects and I think it means that follow-redirects in its current state is broken on node 6. I'd like to figure out if the proper place to fix this is here or in follow-redirects.

Metadata

Metadata

Assignees

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