Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sendResources(responseObject, ctx) {
const _a = responseObject.headers, { vary } = _a, otherHeaders = __rest(_a, ["vary"]);
if (vary) {
vary_1.default(ctx.res, vary);
}
if (responseObject.status === 406 && !this.config.handleContentNegotiation) {
return true;
}
ctx.status(responseObject.status || 200);
Object.keys(otherHeaders).forEach(k => {
ctx.res.set(k, otherHeaders[k]);
});
if (responseObject.body !== undefined) {
ctx.body = new Buffer(responseObject.body);
}
}
sendError(errors, ctx) {