Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

url + http/https: weird api between these module #8722

@yorkie

Description

@yorkie

url.format will return an object owns pathname rather than path, however http.request and https.request do accept path rather than pathname.

sometimes, we would seem to write our program:

var urlobj = url.format('http://github.com/yorkie');
http.request(urlobj, function (res) {
  // actually we get the response from http://github.com
});

path is missing, yeah actually we can add urlobj.path = urlobj.pathname for now, it does work as well, but it's a weird behavior in api level imo.

I'm guessing we should unify these two/three functions definitely, of course backward compatible with url module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions