Skip to content

node 14 file url looses host on windows path #41371

Closed as not planned
Closed as not planned
@lachrist

Description

@lachrist

Version

v14.18.2

Platform

Darwin softs-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Sep 16 20:58:47 PDT 2021; root:xnu-6153.141.40.1~1/RELEASE_X86_64 x86_64

Subsystem

No response

What steps will reproduce the bug?

var url = new URL("file://host/path");
console.log(url.host) // logs "host"
url.pathname = "C:/dir";
console.log(url.host) // logs ""

How often does it reproduce? Is there a required condition?

Nope

What is the expected behavior?

Keep the host field of the url intact on modifying the pathname as the spec indicates. FYI node 16 does not have this bug.

What do you see instead?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions