Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Pass Express request object to redirect handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zarathustra323 committed Jan 29, 2021
1 parent a3c7a09 commit 52d9890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marko-web/express/get-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = async (req, handler) => {
if (to) return websiteRedirect;
// Attempt to find a redirect using the handler.
if (typeof handler !== 'function') return null;
const result = await handler({ from, params });
const result = await handler({ from, params, req });
if (!result || !result.to) return null;
return { ...result, code: result.code || 301 };
};

0 comments on commit 52d9890

Please sign in to comment.