garycourt / uri-js

An RFC 3986 compliant, scheme extendable URI parsing/validating/normalizing/resolving library for JavaScript
Other
305 stars 69 forks source link

WS URI parsing not RFC conform? #62

Open fexpal opened 3 years ago

fexpal commented 3 years ago

I'm not quiet sure if this is a bug, but I think a Websocket URI is not parsed correctly. I think the result should be something like this due to this RFC6455 which refers to this rfc3986#section-3.3:

const x = URI.parse('ws://localhost:8080/example?foo=bar');
//returns:
//{
//  scheme : "ws",
//  host: "localhost",
//     port: "8080",
//  path: "/example",
//  query: "?foo=bar",
//  ressourceName: "/example?foo=bar"
//}

The attribute ressouceName shall contain path and query and path shall not be empty, only if there is no path