(headers)
| 3191 | // a 1xx informational code and it MUST be sent before the request/response |
| 3192 | // headers are sent, or an error will be thrown. |
| 3193 | additionalHeaders(headers) { |
| 3194 | if (this.destroyed || this.closed) |
| 3195 | throw new ERR_HTTP2_INVALID_STREAM(); |
| 3196 | if (this.headersSent) |
| 3197 | throw new ERR_HTTP2_HEADERS_AFTER_RESPOND(); |
| 3198 | |
| 3199 | assertIsObject(headers, 'headers'); |
| 3200 | headers = ObjectAssign({ __proto__: null }, headers); |
| 3201 | |
| 3202 | debugStreamObj(this, 'sending additional headers'); |
| 3203 | |
| 3204 | if (headers[HTTP2_HEADER_STATUS] != null) { |
| 3205 | const statusCode = headers[HTTP2_HEADER_STATUS] |= 0; |
| 3206 | if (statusCode === HTTP_STATUS_SWITCHING_PROTOCOLS) |
| 3207 | throw new ERR_HTTP2_STATUS_101(); |
| 3208 | if (statusCode < 100 || statusCode >= 200) { |
| 3209 | throw new ERR_HTTP2_INVALID_INFO_STATUS(headers[HTTP2_HEADER_STATUS]); |
| 3210 | } |
| 3211 | } |
| 3212 | |
| 3213 | this[kUpdateTimer](); |
| 3214 | |
| 3215 | const headersList = buildNgHeaderString( |
| 3216 | headers, |
| 3217 | assertValidPseudoHeaderResponse, |
| 3218 | this.session[kStrictSingleValueFields], |
| 3219 | ); |
| 3220 | if (!this[kInfoHeaders]) |
| 3221 | this[kInfoHeaders] = [headers]; |
| 3222 | else |
| 3223 | this[kInfoHeaders].push(headers); |
| 3224 | |
| 3225 | const ret = this[kHandle].info(headersList); |
| 3226 | if (ret < 0) |
| 3227 | this.destroy(new NghttpError(ret)); |
| 3228 | } |
| 3229 | } |
| 3230 | |
| 3231 | ServerHttp2Stream.prototype[kProceed] = ServerHttp2Stream.prototype.respond; |
no test coverage detected