-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: address deprecation warning on startup #1497
Conversation
The `body-parser` deprecation warning on startup is due to `express.urlencode()` requiring an `extended` property in the options argument in Express 4.x. Fixes: hubotio#1476
src/robot.js
Outdated
@@ -444,7 +444,7 @@ class Robot { | |||
app.use(express.query()) | |||
|
|||
app.use(express.json()) | |||
app.use(express.urlencoded({ limit, parameterLimit: paramLimit })) | |||
app.use(express.urlencoded({ limit, parameterLimit: paramLimit, extended: false })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the default value is true
(https://expressjs.com/en/api.html#express.urlencoded). Why change the value to false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I chose false
but I'm going to guess that I misunderstood the express docs which say (about extended
): "Using the default is deprecated." I think they mean "not specifying a value and relying on the default value is deprecated" but I interpreted it as "The default is true and using that value is deprecated."
At least that's my story now.
I'll switch it to true
.
This would be a great small change to merge in. Seems like @ctrom 's review isn't enough to merge, is there someone we can ping to expedite this? |
@mistydemeo and @technicalpickles are the only people who have merged commits this year, so maybe one or both of them can make this happen? |
it seems this warning fails heroku deploy
could you merge this fix and release a new version on npm ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry for not addressing this sooner.
🎉 This PR is included in version 3.3.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The
body-parser
deprecation warning on startup is due toexpress.urlencode()
requiring an
extended
property in the options argument in Express 4.x.Fixes: #1476