url.host test is inconsistent with documentation #3062

Closed
AndreasMadsen opened this Issue Apr 4, 2012 · 8 comments

4 participants

@AndreasMadsen
Node.js Foundation member

This line: https://github.com/joyent/node/blob/master/test/simple/test-url.js#L59 should by documentation be:

'host': 'user:pw@www.example.com',

documentation: http://nodejs.org/docs/latest/api/url.html

@isaacs

That changed in 0.7, I believe. Doc bug.

@isaacs

Oh, no, it changed prior to v0.6. Even earlier doc bug :)

@zzak

I will put together a patch for doc/api/url

Is url.format() still valid? I was planning on updating the examples for URL

@zzak

@isaacs @AndreasMadsen I've added #3071 for the URL examples.

Should I change url.format() too?

/cc @bnoordhuis

@AndreasMadsen
Node.js Foundation member

host will be used in place of auth, hostname, and port

If host is only ment to be hostname then that is wrong too.

@zzak

Since the port is parsed from host, I think it should be

* `host` will be used in place of `hostname` and `port`.
@AndreasMadsen
Node.js Foundation member

@zzak I agree host is hostname + ':' + port.

url.parse do also handle host this way.

@zzak zzak added a commit that referenced this issue Apr 8, 2012
@zzak zzak docs: url.host doesn't include auth #3062 d4a04e5
@bnoordhuis bnoordhuis added a commit that closed this issue Apr 16, 2012
@zzak zzak docs: url.host doesn't include auth
Fixes #3062.
59e6b14
@bnoordhuis
Node.js Foundation member

Documented in 59e6b14 and b4626af.

@erikdubbelboer erikdubbelboer added a commit that referenced this issue Apr 18, 2012
@zzak zzak docs: url.host doesn't include auth
Fixes #3062.
c1ab6b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment