Skip to content

Commit

Permalink
Merge pull request #916 from gas-buddy/master
Browse files Browse the repository at this point in the history
Pass request to response interceptor, cleanup operation object passed to them both
  • Loading branch information
fehguy authored Jan 5, 2017
2 parents 9543113 + 759bbb4 commit cdb78f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ SwaggerHttp.prototype.execute = function (obj, opts) {

var responseInterceptor = function(data) {
if(opts && opts.responseInterceptor) {
data = opts.responseInterceptor.apply(data);
data = opts.responseInterceptor.apply(data, [obj]);
}
return success(data);
};

var errorInterceptor = function(data) {
if(opts && opts.responseInterceptor) {
data = opts.responseInterceptor.apply(data);
data = opts.responseInterceptor.apply(data, [obj]);
}
error(data);
};
Expand Down
2 changes: 1 addition & 1 deletion lib/types/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) {
deferred: deferred,
headers: headers,
clientAuthorizations: opts.clientAuthorizations,
operation: this.operation,
operation: this,
connectionAgent: this.connectionAgent,
on: {
response: function (response) {
Expand Down

0 comments on commit cdb78f6

Please sign in to comment.