Skip to content

Commit

Permalink
web > fix next() not being defined for hook error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Mar 2, 2024
1 parent 5bb13c2 commit ba5adf0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ app.get(
const handleChannelEndpoints = async (
req,
res,
next,
{ channelConfigs, shouldCheckSecret = true }
) => {
// Retrieve hook info
Expand Down Expand Up @@ -428,7 +429,7 @@ const handleChannelEndpoints = async (
// Redirecting from / to this endpoint through proxy server to avoid breaking existing hooks
app.post(
'/hook/legacy',
asyncHandler(async (req, res) => {
asyncHandler(async (req, res, next) => {
const { repo, org } = getHookInfo(req.body);

const channels = (
Expand All @@ -452,7 +453,7 @@ app.post(
return res.send(escapeInput`${repo || org} : no legacy channels found`);
}

return await handleChannelEndpoints(req, res, {
return await handleChannelEndpoints(req, res, next, {
channelConfigs: Channel.collection(channels),
shouldCheckSecret: false,
});
Expand All @@ -479,7 +480,7 @@ app.post(
q.whereIn('id', channelIds)
).fetchAll();

return await handleChannelEndpoints(req, res, { channelConfigs });
return await handleChannelEndpoints(req, res, next, { channelConfigs });
})
);

Expand Down

0 comments on commit ba5adf0

Please sign in to comment.