Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track specific validation errors #260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix a URL code-unit check when parsing opaque paths
  • Loading branch information
karwa committed Sep 26, 2023
commit 0ecf6dd9f916ee00726379efef88f5c891fa332e
6 changes: 2 additions & 4 deletions lib/url-state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,8 @@ URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) {
this.url.fragment = "";
this.state = "fragment";
} else {
// TODO: Add: not a URL code point
if (!isNaN(c) && c !== p("%")) {
this.validationErrors.push("invalid-URL-unit");
}
// TODO: If c is not the EOF code point, not a URL code point, and not U+0025 (%),
// invalid-URL-unit validation error.

if (c === p("%") &&
(!infra.isASCIIHex(this.input[this.pointer + 1]) ||
Expand Down