Skip to content
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

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

Trott
Copy link
Contributor

@Trott Trott commented Mar 12, 2019

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: #1476

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 }))
Copy link

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?

Copy link
Contributor Author

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.

@hews
Copy link

hews commented Apr 15, 2019

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?

@Trott
Copy link
Contributor Author

Trott commented Apr 15, 2019

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?

@dfang
Copy link

dfang commented Apr 17, 2019

it seems this warning fails heroku deploy

2019-04-17T04:21:49.605511+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-17T04:21:51.739952+00:00 heroku[web.1]: Starting process with command `bin/hubot -a shell`
2019-04-17T04:21:56.676434+00:00 app[web.1]: audited 242 packages in 2.058s
2019-04-17T04:21:56.678870+00:00 app[web.1]: found 0 vulnerabilities
2019-04-17T04:21:56.678872+00:00 app[web.1]: 
2019-04-17T04:21:57.240952+00:00 app[web.1]: Wed, 17 Apr 2019 04:21:57 GMT body-parser deprecated undefined extended: provide extended option at node_modules/hubot/src/robot.js:447:21
2019-04-17T04:21:57.274518+00:00 app[web.1]: No history available
2019-04-17T04:21:57.398430+00:00 app[web.1]: �[1G�[0Jhwamei> �[9G
2019-04-17T04:21:57.422874+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-17T04:21:57.403448+00:00 heroku[web.1]: Process exited with status 0
2019-04-17T04:30:55.548507+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-17T04:30:57.556203+00:00 heroku[web.1]: Starting process with command `bin/hubot -a shell`
2019-04-17T04:31:02.478230+00:00 app[web.1]: audited 242 packages in 1.517s
2019-04-17T04:31:02.479147+00:00 app[web.1]: found 0 vulnerabilities
2019-04-17T04:31:02.479160+00:00 app[web.1]: 
2019-04-17T04:31:02.809341+00:00 app[web.1]: Wed, 17 Apr 2019 04:31:02 GMT body-parser deprecated undefined extended: provide extended option at node_modules/hubot/src/robot.js:447:21
2019-04-17T04:31:02.828750+00:00 app[web.1]: No history available
2019-04-17T04:31:02.904531+00:00 app[web.1]: �[1G�[0Jhwamei> �[9G
2019-04-17T04:31:02.940924+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-17T04:31:02.909197+00:00 heroku[web.1]: Process exited with status 0

could you merge this fix and release a new version on npm ?

Copy link
Contributor

@mistydemeo mistydemeo left a 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.

@mistydemeo mistydemeo merged commit 7795fe5 into hubotio:master Apr 17, 2019
@hubotbot
Copy link

🎉 This PR is included in version 3.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expressjs/body-parser extended option
8 participants