Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ProxyContext.prototype.setReturnArgByName = function (name, value) {
var ARG_WAS_HANDLED = true;
var returnDesc = this.method.getReturnArgDescByName(name);
var res = this.res;
if (!returnDesc) {
debug('warning: cannot set return value for arg' +
' (%s) without description!', name);
return;
}
if (returnDesc.root) {
this.returnsFile = SharedMethod.isFileType(returnDesc.type);
return;
}
if (returnDesc.http) {
switch (returnDesc.http.target) {
case 'status':
res.status(value);
return ARG_WAS_HANDLED;
case 'header':
res.set(returnDesc.http.header || name, value);
return ARG_WAS_HANDLED;
default:
return ARG_WAS_HANDLED;
}
}
};