Skip to content

Commit

Permalink
Merge pull request #355 from strongloop/fix/traversal-of-computed-htt…
Browse files Browse the repository at this point in the history
…p-args

Don't convert arg values returned by http function
  • Loading branch information
bajtos authored Sep 21, 2016
2 parents 6c89512 + 062d391 commit a27cae5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/shared-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,16 @@ SharedMethod.getType = function(val, targetType) {
*/

SharedMethod.convertArg = function(accept, raw) {
if (accept.http && (accept.http.source === 'req' ||
var isComputedArgument = accept.http && (
typeof accept.http === 'function' ||
accept.http.source === 'req' ||
accept.http.source === 'res' ||
accept.http.source === 'context'
)) {
accept.http.source === 'context');

if (isComputedArgument) {
return raw;
}

if (raw === null || typeof raw !== 'object') {
return raw;
}
Expand Down

0 comments on commit a27cae5

Please sign in to comment.