Skip to content

src: fix leading backslash bug in URL - #36613

Closed
RaisinTen wants to merge 1 commit into
nodejs:masterfrom
RaisinTen:src/fix-url-bug
Closed

src: fix leading backslash bug in URL#36613
RaisinTen wants to merge 1 commit into
nodejs:masterfrom
RaisinTen:src/fix-url-bug

Conversation

@RaisinTen

@RaisinTenRaisinTen commented Dec 23, 2020

Copy link
Copy Markdown
Member

The associated condition mentioned in the URL parsing algorithm of the
WHATWG URL Standard is:
url is special and c is U+005C (\)
So, special_back_slash must be updated whenever special is updated.

Fixes: #36559

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Dec 23, 2020
@RaisinTen

Copy link
Copy Markdown
MemberAuthor

Why are the tests skipped? 🤔

@richardlau

Copy link
Copy Markdown
Member

Why are the tests skipped? 🤔

#35910

@RaisinTen
RaisinTen marked this pull request as ready for review December 23, 2020 15:07
@RaisinTenRaisinTen changed the title src: fix leading backslash bug in URL[WIP] src: fix leading backslash bug in URLDec 23, 2020
@RaisinTenRaisinTen changed the title [WIP] src: fix leading backslash bug in URLsrc: fix leading backslash bug in URLDec 25, 2020
The associated condition mentioned in the URL parsing algorithm of the
WHATWG URL Standard is:
url is special and c is U+005C (\)
So, `special_back_slash` must be updated whenever `special` is updated.
Fixes: nodejs#36559
@RaisinTenRaisinTen added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 25, 2020
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 25, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@RaisinTen

Copy link
Copy Markdown
MemberAuthor

cc @nodejs/url

@RaisinTenRaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 29, 2020
@jasnell

Copy link
Copy Markdown
Member

Landed in b8c15c7

@jasnelljasnell closed this Dec 31, 2020
jasnell pushed a commit that referenced this pull request Dec 31, 2020
The associated condition mentioned in the URL parsing algorithm of the
WHATWG URL Standard is:
url is special and c is U+005C (\)
So, `special_back_slash` must be updated whenever `special` is updated.
Fixes: #36559
PR-URL: #36613
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@RaisinTen
RaisinTen deleted the src/fix-url-bug branch January 1, 2021 14:10
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
The associated condition mentioned in the URL parsing algorithm of the
WHATWG URL Standard is:
url is special and c is U+005C (\)
So, `special_back_slash` must be updated whenever `special` is updated.
Fixes: #36559
PR-URL: #36613
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadamsdanielleadams mentioned this pull request Jan 12, 2021
targos pushed a commit that referenced this pull request May 1, 2021
The associated condition mentioned in the URL parsing algorithm of the
WHATWG URL Standard is:
url is special and c is U+005C (\)
So, `special_back_slash` must be updated whenever `special` is updated.
Fixes: #36559
PR-URL: #36613
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
@bl-ue

bl-ue commented Jun 7, 2021

Copy link
Copy Markdown
Contributor

Shouldn't this PR be semver-minor, @richardlau? It caused a somewhat breaking change (see #38963). Or do we have different rules relating to breaking changes when the change is a bug fix?

@richardlau

Copy link
Copy Markdown
Member

It's only breaking if code is relying on the old incorrect behaviour.
cc @nodejs/url

EXPECT_EQ(simple.protocol(), "http:");
EXPECT_EQ(simple.host(), "x");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, we should always add WPTs for bug fixes to the WHATWG URL parser, so that other implementations (e.g., browsers) can similarly benefit. I've upstreamed two of these tests in web-platform-tests/wpt#29271.

/cc @joyeecheung

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new URL gives wrong result on leading backslash

8 participants

@RaisinTen@richardlau@nodejs-github-bot@jasnell@bl-ue@Trott@TimothyGu@watilde