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

src: fix leading backslash bug in URL #36613

Closed
wants to merge 1 commit into from

Conversation

RaisinTen
Copy link
Contributor

@RaisinTen RaisinTen commented Dec 23, 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

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

@nodejs-github-bot nodejs-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
Contributor Author

Why are the tests skipped? 🤔

@richardlau
Copy link
Member

Why are the tests skipped? 🤔

#35910

@RaisinTen RaisinTen marked this pull request as ready for review December 23, 2020 15:07
@RaisinTen RaisinTen changed the title src: fix leading backslash bug in URL [WIP] src: fix leading backslash bug in URL Dec 23, 2020
@RaisinTen RaisinTen changed the title [WIP] src: fix leading backslash bug in URL src: fix leading backslash bug in URL Dec 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
@RaisinTen RaisinTen added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 25, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 25, 2020
@nodejs-github-bot
Copy link
Collaborator

@RaisinTen
Copy link
Contributor Author

cc @nodejs/url

@RaisinTen RaisinTen 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
Member

jasnell commented Dec 31, 2020

Landed in b8c15c7

@jasnell jasnell 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 <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@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 <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@danielleadams danielleadams 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 <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
@bl-ue
Copy link
Contributor

bl-ue commented Jun 7, 2021

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
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
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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs 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