Skip to content

Commit 109af68

Browse files
committed
'req.param' was deprecated. Replace with 'req.query'
Summary: Express.js deprecated `req.param` in favor of `req.query`. Changed semantics slightly. `req.param` used to be a function that would fetch the supplied param. `req.query` is a function that returns a JSON object of all params and values. Test Plan: This would only happen on subscription since that's where this was used. Patched the change to a test app instance on Heroku. Deployed. Added a new subscription. Did not see deprecation logs anymore.
1 parent 893e3df commit 109af68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

heroku/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ app.get('/', function(req, res) {
2525
res.send('<pre>' + JSON.stringify(received_updates, null, 2) + '</pre>');
2626
});
2727

28-
app.get(['/facebook', '/instagram'], function(req, res) {
28+
app.get(['/facebook', '/instagram'], function(req, res) {
2929
if (
30-
req.param('hub.mode') == 'subscribe' &&
31-
req.param('hub.verify_token') == token
30+
req.query['hub.mode'] == 'subscribe' &&
31+
req.query['hub.verify_token'] == token
3232
) {
33-
res.send(req.param('hub.challenge'));
33+
res.send(req.query['hub.challenge']);
3434
} else {
3535
res.sendStatus(400);
3636
}

0 commit comments

Comments
 (0)