(reply, statusCode)
| 563 | } |
| 564 | |
| 565 | function safeWriteHead (reply, statusCode) { |
| 566 | const res = reply.raw |
| 567 | try { |
| 568 | res.writeHead(statusCode, reply[kReplyHeaders]) |
| 569 | } catch (err) { |
| 570 | if (err.code === 'ERR_HTTP_HEADERS_SENT') { |
| 571 | reply.log.warn(`Reply was already sent, did you forget to "return reply" in the "${reply.request.raw.url}" (${reply.request.raw.method}) route?`) |
| 572 | } |
| 573 | throw err |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | function onSendEnd (reply, payload) { |
| 578 | const res = reply.raw |