mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Website: update guaranteed locals in custom hook (#18296)
Closes: #18295 Changes: - Updated the custom hook to set `res.locals` for HEAD requests to prevent 500 errors when a request is sent to a page that references `res.locals.me`
This commit is contained in:
parent
5311aec0fe
commit
5692598143
1 changed files with 2 additions and 2 deletions
4
website/api/hooks/custom/index.js
vendored
4
website/api/hooks/custom/index.js
vendored
|
|
@ -123,9 +123,9 @@ will be disabled and/or hidden in the UI.
|
|||
|
||||
var url = require('url');
|
||||
|
||||
// First, if this is a GET request (and thus potentially a view),
|
||||
// First, if this is a GET request (and thus potentially a view) or a HEAD request,
|
||||
// attach a couple of guaranteed locals.
|
||||
if (req.method === 'GET') {
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
|
||||
// The `_environment` local lets us do a little workaround to make Vue.js
|
||||
// run in "production mode" without unnecessarily involving complexities
|
||||
|
|
|
|||
Loading…
Reference in a new issue