Skip to content

Commit 9ac7ac9

Browse files
committed
http2: near full http1 compatibility, add tests
Extensive re-work of http1 compatibility layer based on tests in express, on-finished and finalhandler. Fix handling of HEAD method to match http1. Adjust write, end, etc. to call writeHead as in http1 and as expected by user-land modules. Add socket proxy that instead uses the Http2Stream for the vast majority of socket interactions. Add and change tests to closer represent http1 behaviour. Refs: #15633 Refs: https://github.com/expressjs/express/tree/master/test Refs: https://github.com/jshttp/on-finished/blob/master/test/test.js Refs: https://github.com/pillarjs/finalhandler/blob/master/test/test.js
1 parent ccd3afc commit 9ac7ac9

19 files changed

+794
-145
lines changed

lib/internal/errors.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ E('ERR_HTTP2_INVALID_SETTING_VALUE',
178178
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
179179
E('ERR_HTTP2_MAX_PENDING_SETTINGS_ACK',
180180
(max) => `Maximum number of pending settings acknowledgements (${max})`);
181+
E('ERR_HTTP2_NO_SOCKET_MANIPULATION',
182+
'HTTP/2 sockets should not be directly read from, written to, ' +
183+
'paused and/or resumed.');
181184
E('ERR_HTTP2_OUT_OF_STREAMS',
182185
'No stream ID is available because maximum stream ID has been reached');
183186
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',

0 commit comments

Comments
 (0)