Skip to content

Default to WHATWG URL parser in http.request (and friends) #19468

Closed
@TimothyGu

Description

@TimothyGu
  • Version: master
  • Platform: all
  • Subsystem: http

Currently, http.request('http://brave.com%60x.code-fu.org/') requests http://brave.com/%60x.code-fu.org/ rather than http://brave.com`x.code-fu.org/. This behavior deviates from the behavior standardized in WHATWG URL Standard and used in browsers, and have caused dangerous security implications for downstream embedders (see talk by @diracdeltas).

This is due to the http.request function using the legacy url.parse function rather than the new WHATWG-compliant URL parser. We should switch the URL parser used for string-typed argument to the standard-complaint parser.

This switch will surely have compatibility implications, but I doubt it will cause major breakage since most request-style libraries pass in an object instead of a string as the first argument anyway.

/cc @annevk @BrendanEich (See original tweet.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.urlIssues and PRs related to the legacy built-in url module.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