mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Website: update custom hook to prevent 500 error from HEAD requests. (#17331)
Changes: - Updated the custom hook to set `res.locals.primaryBuyingSituation` for HEAD requests to prevent 500 errors when `primaryBuyingSituation` is not set to `undefined`.
This commit is contained in:
parent
fd80b47a9d
commit
302c594046
2
website/api/hooks/custom/index.js
vendored
2
website/api/hooks/custom/index.js
vendored
@ -156,7 +156,7 @@ will be disabled and/or hidden in the UI.
|
||||
// FUTURE: Auto-redirect without the querystring after absorbtion to make it prettier in the URL bar.
|
||||
// (except this probably messes up analytics so before doing that, figure out how to solve that problem)
|
||||
}//fi
|
||||
if (req.method === 'GET') {
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
// Include information about the primary buying situation
|
||||
// If set in the session (e.g. from an ad), use the primary buying situation for personalization.
|
||||
res.locals.primaryBuyingSituation = req.session.primaryBuyingSituation || undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user