0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

5 Commits

Author SHA1 Message Date
Timothy Gu
91a1bbe305
url: update IDNA handling
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.

PR-URL: https://github.com/nodejs/node/pull/13362
Refs: https://github.com/whatwg/url/pull/309
Refs: https://github.com/w3c/web-platform-tests/pull/5976
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-06-06 23:33:56 -07:00
Rajaram Gaunker
06a617aa21
url: update IDNA error conditions
This commit contains three separate changes:

- Always return a string from ToUnicode no matter if an error occurred.
- Disable CheckHyphens boolean flag. This flag will soon be enabled in
  the URL Standard, but is implemented manually by selectively ignoring
  certain errors.
- Enable CheckBidi boolean flag per URL Standard update.

This allows domain names with hyphens at 3 and 4th position, as well as
those with leading and trailing hyphens. They are technically invalid,
but seen in the wild.

Tests are updated and simplified accordingly.

PR-URL: https://github.com/nodejs/node/pull/12966
Fixes: https://github.com/nodejs/node/issues/12965
Refs: https://github.com/whatwg/url/pull/309
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-05-20 00:36:57 -07:00
Timothy Gu
d457a986a0 url: port WHATWG URL API to internal/errors
Also slightly revises grammar.

PR-URL: https://github.com/nodejs/node/pull/12574
Refs: https://github.com/nodejs/node/issues/11273
Refs: https://github.com/nodejs/node/issues/11299
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-04-25 16:33:08 -07:00
Timothy Gu
c4469c49ec url: error when domainTo*() is called w/o argument
PR-URL: https://github.com/nodejs/node/pull/12134
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-04 09:51:44 -07:00
Timothy Gu
6c213978b7 test: more comprehensive IDNA test cases
- Split the tests out to a separate file
- Add invalid cases
- Add tests for url.domainTo*()
- Re-enable previously broken WPT URL parsing tests

PR-URL: https://github.com/nodejs/node/pull/11549
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-28 18:32:01 -08:00