MCPcopy Create free account
hub / github.com/fastify/fastify / buildReply

Function buildReply

lib/reply.js:1001–1029  ·  view source on GitHub ↗
(R)

Source from the content-addressed store, hash-verified

999}
1000
1001function buildReply (R) {
1002 const props = R.props.slice()
1003
1004 function _Reply (res, request, log) {
1005 this.raw = res
1006 this[kReplyIsError] = false
1007 this[kReplyErrorHandlerCalled] = false
1008 this[kReplyHijacked] = false
1009 this[kReplySerializer] = null
1010 this.request = request
1011 this[kReplyHeaders] = {}
1012 this[kReplyTrailers] = null
1013 this[kReplyStartTime] = undefined
1014 this[kReplyEndTime] = undefined
1015 this.log = log
1016
1017 let prop
1018
1019 for (let i = 0; i < props.length; i++) {
1020 prop = props[i]
1021 this[prop.key] = prop.value
1022 }
1023 }
1024 Object.setPrototypeOf(_Reply.prototype, R.prototype)
1025 Object.setPrototypeOf(_Reply, R)
1026 _Reply.parent = R
1027 _Reply.props = props
1028 return _Reply
1029}
1030
1031function notFound (reply) {
1032 if (reply[kRouteContext][kFourOhFourContext] === null) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected