Skip to content

Commit

Permalink
Added response monkey patching.
Browse files Browse the repository at this point in the history
  • Loading branch information
idralyuk committed Nov 3, 2011
1 parent d1d6898 commit 3db25d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/engine/lib/engine/http.request.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,16 @@ function sendOneRequest(args, resourceUri, params, holder, cb) {
}
if(res.statusCode >= 200 && res.statusCode <= 300) {
if(respJson) {
if(resource.monkeyPatch && resource.monkeyPatch['patch response']) {
try {
respJson = resource.monkeyPatch['patch response']({
body: respJson
});
}
catch(e) {
return httpReqTx.cb(e);
}
}
// Projections
project.run(resource.resultSet, statement, respJson, function(filtered) {
return httpReqTx.cb(undefined, {
Expand Down

0 comments on commit 3db25d6

Please sign in to comment.