garycourt / uri-js

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

incorrect parse of url #7

Closed codeuniquely closed 9 years ago

codeuniquely commented 9 years ago

passing in a URL of: http://localhost:3000/Hi5Cloud/ContentManagement/uploadFile/uqAKRnpeeugwH4gX8dMsGve87Tof/TAC/600000000/.

getting the following object

{
    fragment: undefined
    host: "localhost%3A3000"
    path: "/Hi5Cloud/ContentManagement/uploadFile/uqAKRnpeeugwH4gX8dMsGve87Tof/TAC/600000000/"
    port: undefined
    query: undefined
    reference: "absolute"
    scheme: "http"
    userinfo: undefined
}

obviously the host and port values are broken ...

When I then to a xhr.open() using this I get the following error "Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."

garycourt commented 9 years ago

It works fine for me. Make sure the URL is not being escaped before you pass it to URI.parse.

codeuniquely commented 9 years ago

you can clearly see from the "cut and pasted" and pasted URL above that its not escaped ... Don't worry found someone else library that actually works -

garycourt commented 9 years ago

Well, I'm getting a different object being generated then you, with the correct output. I still think the problem is on your end.