8000 Incorrect pathname in version 1.5.0 · Issue #199 · unshiftio/url-parse · GitHub
[go: up one dir, main page]

Skip to content
Incorrect pathname in version 1.5.0 #199
@gdelacruzfdez

Description

@gdelacruzfdez

Good morning,
Since the last update the pathname is not correctly parsed.

If I run this example from http://localhost:3000/PROD/trends:

new URL('/dataApi/PROD/ws')

Version 1.5.0 of the library returns this:

{
   "auth":"",
   "hash":"",
   "host":"localhost:3000",
   "hostname":"localhost",
   "href":"http://localhost:3000/PROD/dataApi/PROD/ws",
   "origin":"http://localhost:3000",
   "password":"",
   "pathname":"/PROD/dataApi/PROD/ws",
   "port":"3000",
   "protocol":"http:",
   "query":"",
   "slashes":true,
   "username":""
}

While version 1.4.7 was returning this:

{
   "auth":"",
   "hash":"",
   "host":"localhost:3000",
   "hostname":"localhost",
   "href":"http://localhost:3000/dataApi/PROD/ws",
   "origin":"http://localhost:3000",
   "password":"",
   "pathname":"//dataApi/PROD/ws",
   "port":"3000",
   "protocol":"http:",
   "query":"",
   "slashes":true,
   "username":""
}

AFAIK, the pathname of the page you are in shouldn't be taken into account to parse the URL.

This bug is breaking sockjs-client library.

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

      0