-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request.query.hasOwnProperty causes "hasOwnProperty is not a function" error #3280
Comments
This is expected. nodejs/node#6289 modified the |
Thanks @jasnell. Closing issue. |
for node 6 compatibility see hapijs/hapi#3280
Use robust lib instead of string processing to extract query parameters from urls. See hapijs/hapi#3280 for explanation on unintuitive query object prototype. Bug: T187306 Change-Id: Idf80128af6859af8b7d568f59f7d825e3cdc5a91
hapijs/hapi#3280 (comment) Fixing: TypeError: arguments.hasOwnProperty is not a function at parseAttacksArguments (/home/ogajduse/Documents/repos/dosgen/dosgen-web/routes/dosgen.js:67:23) at /home/ogajduse/Documents/repos/dosgen/dosgen-web/routes/dosgen.js:24:16 at Layer.handle [as handle_request] (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/layer.js:82:5) at next (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/route.js:110:13) at Route.dispatch (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/route.js:91:3) at Layer.handle [as handle_request] (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/layer.js:82:5) at /home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/index.js:267:22 at Function.proto.process_params (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/index.js:321:12) at next (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/index.js:261:10) at Function.proto.handle (/home/ogajduse/Documents/repos/dosgen/dosgen-web/node_modules/express/lib/router/index.js:166:3)
Could a change to the querystring type file help with this? TypeScript should definitely be throwing an error |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I'm having a new issue with node v6.3.1 and hapi v14.1.0.
A handler function with
request.query.hasOwnProperty('whatever')
will result in a "request.query.hasOwnProperty is not a function" error.Changing to
Object.prototype.hasOwnProperty.call(request.query, 'whatever')
works.typeof request
is 'object', so I'm not sure why this method is missing or why calling it from Object works.The text was updated successfully, but these errors were encountered: