Skip to content

Commit

Permalink
Fix http2 request with node 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaani committed Sep 13, 2018
1 parent b08371c commit 1db3a4b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ matrix:
include:
- node_js: "9"
env: BROWSER=1
include:
- node_js: "10"
env: HTTP2_TEST=1

before_install:
- "test -z $(echo $HTTP2_TEST) || npm install https://github.com/sogaani/express.git#initial-support-http2"
- "rm -f package-lock.json npm-shrinkwrap.json"
4 changes: 3 additions & 1 deletion lib/node/http2wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ Request.prototype.createUnixConnection = function (authority, options) {
}

Request.prototype.setNoDelay = function (bool) {
this.session.socket.setNoDelay(bool);
// We can not use setNoDelay with HTTP/2.
// Node 10 limits http2session.socket methods to ones safe to use with HTTP/2.
// See also https://nodejs.org/api/http2.html#http2_http2session_socket
}

Request.prototype.getFrame = function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"body-parser": "^1.18.2",
"browserify": "^16.2.0",
"cookie-parser": "^1.4.3",
"express": "^4.16.3",
"express": "git+https://github.com/sogaani/express.git#initial-support-http2",
"express-session": "^1.15.6",
"marked": "^0.5.0",
"mocha": "^3.5.3",
Expand Down

0 comments on commit 1db3a4b

Please sign in to comment.