Skip to content

Quotes in the URL are not percent encoded #46850

Closed
@asamuzaK

Description

@asamuzaK

Version

19.7.0

Platform

all

Subsystem

No response

What steps will reproduce the bug?

When parsing a url containing double quotes with new URL(), the quotes are not percent encoded.

Test code:

const { href } = new URL('https://example.com/"quoted"');
console.log(href);

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

Always

What is the expected behavior?

Expected:

const { href } = new URL('https://example.com/"quoted"');
console.log(href);
// => https://example.com/%22quoted%22

What do you see instead?

Actual:

const { href } = new URL('https://example.com/"quoted"');
console.log(href);
// => https://example.com/"quoted"

Additional information

Last good: Node.js v19.6.1
First bad: Node.js v19.7.0

Seem to be regressed by #46410

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues with confirmed bugs.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