HTTP2 server options must be an object #19

Open
opened 2019-11-26 16:55:52 +00:00 by Ghost · 2 comments

example

In example, the glx.http2Server method appears to be documented with the incorrect signature.

var http2Server = glx.http2Server(function(req, res) {})

is wrong. It should probably be

var http2Server = glx.http2Server({ ...tlsOptions }, function (req, res) {})
internal/http2/util.js:513
    throw new ERR_INVALID_ARG_TYPE(name, types || 'Object', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "options" argument must be of type Object. Received type function

What TLS options are supposed to be provided to the HTTP2 server?

[example](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/http2/server.js#L20) In example, the `glx.http2Server` method appears to be documented with the incorrect signature. ```javascript var http2Server = glx.http2Server(function(req, res) {}) ``` is wrong. It should probably be ```javascript var http2Server = glx.http2Server({ ...tlsOptions }, function (req, res) {}) ``` ``` internal/http2/util.js:513 throw new ERR_INVALID_ARG_TYPE(name, types || 'Object', value); ^ TypeError [ERR_INVALID_ARG_TYPE]: The "options" argument must be of type Object. Received type function ``` What TLS options are supposed to be provided to the HTTP2 server?
Owner

An empty object {} or null should do just fine.

Would you mind making a PR for the docs?

An empty object `{}` or `null` should do just fine. Would you mind making a PR for the docs?
Author

@solderjs I think you fixed this one.

@solderjs I think you fixed this one.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock-express.js#19
No description provided.