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

Misleading HTTP2 authority documentation #31827

Closed
szmarczak opened this issue Feb 17, 2020 · 2 comments
Closed

Misleading HTTP2 authority documentation #31827

szmarczak opened this issue Feb 17, 2020 · 2 comments

Comments

@szmarczak
Copy link
Member

http2.connect(authority[, options][, listener])

According to the HTTP2 spec:

The :authority pseudo-header field includes the authority portion of the target URI ([RFC3986], Section 3.2). The authority MUST NOT include the deprecated userinfo subcomponent for http or https schemed URIs.

authority = [ userinfo "@" ] host [ ":" port ]

So running http2.connect('google.com') should work, but it doesn't:

TypeError [ERR_INVALID_URL]: Invalid URL: google.com

I believe that it should be http2.connect(origin[, options][, listener]).
For example, url.origin returns protocol://authority.

@jasnell
Copy link
Member

jasnell commented Feb 17, 2020

The API requires the https:// or http:// prefix. So it should be http2.connect('https://google.com'). The documentation needs to be clearer on this.

jasnell added a commit to jasnell/node that referenced this issue Feb 17, 2020
@jasnell
Copy link
Member

jasnell commented Feb 17, 2020

PR to clarify docs: #31828

codebytere pushed a commit that referenced this issue Feb 27, 2020
Fixes: #31827

PR-URL: #31828
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Signed-off-by: James M Snell <[email protected]>
codebytere pushed a commit that referenced this issue Mar 15, 2020
Fixes: #31827

PR-URL: #31828
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Signed-off-by: James M Snell <[email protected]>
codebytere pushed a commit that referenced this issue Mar 17, 2020
Fixes: #31827

PR-URL: #31828
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Signed-off-by: James M Snell <[email protected]>
codebytere pushed a commit that referenced this issue Mar 30, 2020
Fixes: #31827

PR-URL: #31828
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Signed-off-by: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants