Skip to content

Calling absoluteTo on URIs that are already absolute causes error #355

Closed
@mikayla-maki

Description

@mikayla-maki

To reproduce, install the library with npm and then create a file with the following lines:

var URI = require("urijs");
var google = new URI('http://www.google.com');
google.absoluteTo("http://");

Running node test.js gives me this error: TypeError: Hostname cannot be empty, if protocol is http

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions