(trailers)
| 383 | } |
| 384 | |
| 385 | onResponseEnd (trailers) { |
| 386 | this.onFinally() |
| 387 | |
| 388 | assert(!this.aborted) |
| 389 | assert(!this.completed) |
| 390 | |
| 391 | this.completed = true |
| 392 | if (channels.trailers.hasSubscribers) { |
| 393 | channels.trailers.publish({ request: this, trailers }) |
| 394 | } |
| 395 | |
| 396 | const controller = this[kController] |
| 397 | if (controller) { |
| 398 | controller.rawTrailers = trailers |
| 399 | } |
| 400 | |
| 401 | const parsedTrailers = Array.isArray(trailers) ? parseHeaders(trailers) : trailers |
| 402 | |
| 403 | try { |
| 404 | return this[kHandler].onResponseEnd?.(controller, parsedTrailers) |
| 405 | } catch (err) { |
| 406 | // TODO (fix): This might be a bad idea? |
| 407 | this.onResponseError(err) |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | onResponseError (error) { |
| 412 | this.onFinally() |
nothing calls this directly
no test coverage detected