Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing specific URI #190

Closed
SunilAgrawal opened this issue Feb 24, 2015 · 4 comments
Closed

Error parsing specific URI #190

SunilAgrawal opened this issue Feb 24, 2015 · 4 comments

Comments

@SunilAgrawal
Copy link

When I parse the below URI I get somewhat incorrect results, particular the 'hostname' field.

https://moe.linkedinlabs.com:443/pal2/v1/people::(email=XXX@XXX.example.com):public:(id,first-name,last-name,distance,picture-url,site-standard-profile-request,headline,industry,LOCATION:(name),three-current-positions:(title,company:(id,name)))?trk=MOE&ver=16&escape=html&_=1424816267333

I get hostname to include the port number and the port as null.

rodneyrehm added a commit that referenced this issue Feb 24, 2015
@SunilAgrawal
Copy link
Author

Shouldn't the hostname only have the name of the host, and the port number
have '443'? Why is the port number null?

On Tue, Feb 24, 2015 at 3:12 PM, Rodney Rehm notifications@github.com
wrote:

I'm not sure I can reproduce your problem, as the following looks good to
me. What's your code look like?

var s = 'https://moe.linkedinlabs.com:443/pal2/v1/people::(email=XXX@XXX.example.com):public:(id,first-name,last-name,distance,picture-url,site-standard-profile-request,headline,industry,LOCATION:(name),three-current-positions:(title,company:(id,name)))?trk=MOE&ver=16&escape=html&_=1424816267333';var u = URI(s);
console.log(JSON.stringify(u.parts, null, 2));// prints
{
"protocol": "https",
"username": null,
"password": null,
"hostname": "moe.linkedinlabs.com:443",
"urn": null,
"port": null,
"path": "/pal2/v1/people::(email=XXX@XXX.example.com):public:(id,first-name,last-name,distance,picture-url,site-standard-profile-request,headline,industry,LOCATION:(name),three-current-positions:(title,company:(id,name)))",
"query": "trk=MOE&ver=16&escape=html&
=1424816267333",
"fragment": null,
"duplicateQueryParameters": false,
"escapeQuerySpace": true
}
console.log(u.hostname());//prints:"moe.linkedinlabs.com:443"


Reply to this email directly or view it on GitHub
#190 (comment).

@rodneyrehm
Copy link
Member

good catch! fixed in master.

@SunilAgrawal
Copy link
Author

When will this make the mainline? I usually use the online build tool to get a custom build of URI.js.

@rodneyrehm
Copy link
Member

When will this make the mainline?

now: v1.14.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants