Skip to content

url.pathToFileURL should not dedup '/' in path #35507

Description

@bmeck

Found while checking: #35429

Currently it is not possible to have a path represent the file URL new URL('file:///a//b') when going through url.pathToFileURL. url.fileURLToPath does property preserve the // in the path already. This causes round trips to be lossy.

  • Version: 14
  • Platform: OSX
  • Subsystem: url

What steps will reproduce the bug?

console.log(url.pathToFileURL('/a//b').href);

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

Always

What is the expected behavior?

file:///a//b

What do you see instead?

file:///a/b

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.urlIssues and PRs related to the legacy built-in url module.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