Skip to content

Commit

Permalink
fix bug in API w/ serializer on v6. query maybe an empty object
Browse files Browse the repository at this point in the history
nodejs/node#6289
This pull request changes the query string to be an empty object rather
than an object inherited from Object.prototype. So it no longer has
the hasOwnProperty method
  • Loading branch information
esatterwhite committed Jul 16, 2016
1 parent cf1544d commit e9b5317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var Class = require( './class' ) // this is Class
, util = require('util')
, Boom = require('boom')
, isObject = require('mout/lang/isObject')
, has = require('mout/object/hasOwn')
, debug = require('debug')('tastypie:api')
, Options = require( './class/options' )
, pkg = require('../package.json')
Expand Down Expand Up @@ -119,7 +120,7 @@ Api = new Class( /** @lends module:NAME.Api.prototype */{

debug('requested format %s', format);

if( query.hasOwnProperty('callback') && !( query.hasOwnProperty('format') ) ){
if( has(query,'callback') && !( has(query, 'format') ) ){
return reply.continue();
}

Expand Down

0 comments on commit e9b5317

Please sign in to comment.