@@ -849,6 +849,15 @@ used exclusively on HTTP/2 Clients. `Http2Stream` instances on the client
849849provide events such as ` 'response' ` and ` 'push' ` that are only relevant on
850850the client.
851851
852+ #### Event: 'continue'
853+ <!-- YAML
854+ added: REPLACEME
855+ -->
856+
857+ Emitted when the server sends a ` 100 Continue ` status, usually because
858+ the request contained ` Expect: 100-continue ` . This is an instruction that
859+ the client should send the request body.
860+
852861#### Event: 'headers'
853862<!-- YAML
854863added: v8.4.0
@@ -1306,6 +1315,28 @@ added: v8.4.0
13061315The ` 'timeout' ` event is emitted when there is no activity on the Server for
13071316a given number of milliseconds set using ` http2server.setTimeout() ` .
13081317
1318+ #### Event: 'checkContinue'
1319+ <!-- YAML
1320+ added: REPLACEME
1321+ -->
1322+
1323+ * ` request ` {http2.Http2ServerRequest}
1324+ * ` response ` {http2.Http2ServerResponse}
1325+
1326+ If a [ ` 'request' ` ] [ ] listener is registered or [ ` 'http2.createServer()' ` ] [ ] is
1327+ supplied a callback function, the ` 'checkContinue' ` event is emitted each time
1328+ a request with an HTTP ` Expect: 100-continue ` is received. If this event is
1329+ not listened for, the server will automatically respond with a status
1330+ ` 100 Continue ` as appropriate.
1331+
1332+ Handling this event involves calling [ ` response.writeContinue() ` ] [ ] if the client
1333+ should continue to send the request body, or generating an appropriate HTTP
1334+ response (e.g. 400 Bad Request) if the client should not continue to send the
1335+ request body.
1336+
1337+ Note that when this event is emitted and handled, the [ ` 'request' ` ] [ ] event will
1338+ not be emitted.
1339+
13091340### Class: Http2SecureServer
13101341<!-- YAML
13111342added: v8.4.0
@@ -1389,6 +1420,28 @@ per session. See the [Compatibility API](compatiblity-api).
13891420added: v8.4.0
13901421-->
13911422
1423+ #### Event: 'checkContinue'
1424+ <!-- YAML
1425+ added: REPLACEME
1426+ -->
1427+
1428+ * ` request ` {http2.Http2ServerRequest}
1429+ * ` response ` {http2.Http2ServerResponse}
1430+
1431+ If a [ ` 'request' ` ] [ ] listener is registered or [ ` 'http2.createSecureServer()' ` ] [ ]
1432+ is supplied a callback function, the ` 'checkContinue' ` event is emitted each
1433+ time a request with an HTTP ` Expect: 100-continue ` is received. If this event
1434+ is not listened for, the server will automatically respond with a status
1435+ ` 100 Continue ` as appropriate.
1436+
1437+ Handling this event involves calling [ ` response.writeContinue() ` ] [ ] if the client
1438+ should continue to send the request body, or generating an appropriate HTTP
1439+ response (e.g. 400 Bad Request) if the client should not continue to send the
1440+ request body.
1441+
1442+ Note that when this event is emitted and handled, the [ ` 'request' ` ] [ ] event will
1443+ not be emitted.
1444+
13921445### http2.createServer(options[ , onRequestHandler] )
13931446<!-- YAML
13941447added: v8.4.0
@@ -2537,8 +2590,9 @@ buffer. Returns `false` if all or part of the data was queued in user memory.
25372590added: v8.4.0
25382591-->
25392592
2540- Throws an error as the ` 'continue' ` flow is not current implemented. Added for
2541- parity with [ HTTP/1] ( ) .
2593+ Sends a status ` 100 Continue ` to the client, indicating that the request body
2594+ should be sent. See the [ ` 'checkContinue' ` ] [ ] event on ` Http2Server ` and
2595+ ` Http2SecureServer ` .
25422596
25432597### response.writeHead(statusCode[ , statusMessage] [ , headers ] )
25442598<!-- YAML
@@ -2618,6 +2672,7 @@ if the stream is closed.
26182672[ Settings Object ] : #http2_settings_object
26192673[ Using options.selectPadding ] : #http2_using_options_selectpadding
26202674[ Writable Stream ] : stream.html#stream_writable_streams
2675+ [ `'checkContinue'` ] : #http2_event_checkcontinue
26212676[ `'request'` ] : #http2_event_request
26222677[ `'unknownProtocol'` ] : #http2_event_unknownprotocol
26232678[ `ClientHttp2Stream` ] : #http2_class_clienthttp2stream
@@ -2628,14 +2683,17 @@ if the stream is closed.
26282683[ `ServerRequest` ] : #http2_class_server_request
26292684[ `TypeError` ] : errors.html#errors_class_typeerror
26302685[ `http2.SecureServer` ] : #http2_class_http2secureserver
2686+ [ `http2.createSecureServer()` ] : #http2_createsecureserver_options_onrequesthandler
26312687[ `http2.Server` ] : #http2_class_http2server
2688+ [ `http2.createServer()` ] : #http2_createserver_options_onrequesthandler
26322689[ `net.Socket` ] : net.html#net_class_net_socket
26332690[ `request.socket.getPeerCertificate()` ] : tls.html#tls_tlssocket_getpeercertificate_detailed
26342691[ `response.end()` ] : #http2_response_end_data_encoding_callback
26352692[ `response.setHeader()` ] : #http2_response_setheader_name_value
26362693[ `response.socket` ] : #http2_response_socket
26372694[ `response.write()` ] : #http2_response_write_chunk_encoding_callback
26382695[ `response.write(data, encoding)` ] : http.html#http_response_write_chunk_encoding_callback
2696+ [ `response.writeContinue()` ] : #http2_response_writecontinue
26392697[ `response.writeHead()` ] : #http2_response_writehead_statuscode_statusmessage_headers
26402698[ `stream.pushStream()` ] : #http2_stream-pushstream
26412699[ `tls.TLSSocket` ] : tls.html#tls_class_tls_tlssocket
0 commit comments