Skip to content

Commit 62aa257

Browse files
committed
added: backward compatibilty tests
1 parent 1eda39e commit 62aa257

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/parallel/test-http2-https-fallback-http-server-options.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ const ca = fixtures.readKey('fake-startcom-root-cert.pem');
2020
function onRequest(request, response) {
2121
const { socket: { alpnProtocol } } = request.httpVersion === '2.0' ?
2222
request.stream.session : request;
23-
// Verify that keepAliveTimeout is set when allowHTTP1 is true
23+
// Verify that http1Options are applied when allowHTTP1 is true
2424
if (request.httpVersion === '1.1') {
25-
assert.strictEqual(typeof request.socket.server.keepAliveTimeout, 'number');
26-
assert.strictEqual(request.socket.server.keepAliveTimeout, 5000);
25+
assert.strictEqual(request.socket.server.keepAliveTimeout, 10000);
2726
}
2827
response.status(200);
2928
response.end(JSON.stringify({
@@ -51,8 +50,11 @@ class MyServerResponse extends http.ServerResponse {
5150
{
5251
cert,
5352
key, allowHTTP1: true,
54-
Http1IncomingMessage: MyIncomingMessage,
55-
Http1ServerResponse: MyServerResponse
53+
http1Options: {
54+
IncomingMessage: MyIncomingMessage,
55+
ServerResponse: MyServerResponse,
56+
keepAliveTimeout: 10000,
57+
},
5658
},
5759
common.mustCall(onRequest, 1)
5860
);

0 commit comments

Comments
 (0)