diff --git a/testing/xpcshell/node-http2/HISTORY.md b/testing/xpcshell/node-http2/HISTORY.md index e8328227cf60..cf1ac05046cb 100644 --- a/testing/xpcshell/node-http2/HISTORY.md +++ b/testing/xpcshell/node-http2/HISTORY.md @@ -1,6 +1,11 @@ Version history =============== +### 3.1.1 (2015-01-29) ### + +* Bugfix release. +* Fixes an issue sending a push promise that is large enough to fill the frame (#93). + ### 3.1.0 (2014-12-11) ### * Upgrade to the latest draft: [draft-ietf-httpbis-http2-16] diff --git a/testing/xpcshell/node-http2/lib/protocol/compressor.js b/testing/xpcshell/node-http2/lib/protocol/compressor.js index f7c60dedd731..a410f0f14f47 100644 --- a/testing/xpcshell/node-http2/lib/protocol/compressor.js +++ b/testing/xpcshell/node-http2/lib/protocol/compressor.js @@ -1163,7 +1163,11 @@ Compressor.prototype._transform = function _transform(frame, encoding, done) { if (frame.type === 'HEADERS' || frame.type === 'PUSH_PROMISE') { var buffer = this.compress(frame.headers); - var chunks = cut(buffer, MAX_HTTP_PAYLOAD_SIZE); + // This will result in CONTINUATIONs from a PUSH_PROMISE being 4 bytes shorter than they could + // be, but that's not the end of the world, and it prevents us from going over MAX_HTTP_PAYLOAD_SIZE + // on the initial PUSH_PROMISE frame. + var adjustment = frame.type === 'PUSH_PROMISE' ? 4 : 0; + var chunks = cut(buffer, MAX_HTTP_PAYLOAD_SIZE - adjustment); for (var i = 0; i < chunks.length; i++) { var chunkFrame; diff --git a/testing/xpcshell/node-http2/package.json b/testing/xpcshell/node-http2/package.json index 3a1bad4686a7..d76b76a5c772 100644 --- a/testing/xpcshell/node-http2/package.json +++ b/testing/xpcshell/node-http2/package.json @@ -1,6 +1,6 @@ { "name": "http2", - "version": "3.1.0", + "version": "3.1.1", "description": "An HTTP/2 client and server implementation", "main": "lib/index.js", "engines" : {