From c81284eea2d0506f37d00e4d6a0724dc4e3432aa Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 11 Jun 2026 17:34:29 -0500 Subject: [PATCH] Website: Update error handler in http config (#47467) Related to: https://github.com/fleetdm/fleet/issues/47385 Changes: - updated the `onBodyParserError` error handling function in the website's http config to return a 408 response when skipper throws a `EUNFNTEX` error. --- website/config/http.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/config/http.js b/website/config/http.js index d47702140c..980fe1ea87 100644 --- a/website/config/http.js +++ b/website/config/http.js @@ -62,6 +62,9 @@ module.exports.http = { // If an error occurs and this was a request going to a static asset, return a 403 response. } else if(req.url.match(sails.LOOKS_LIKE_ASSET_RX)) { return res.status(403).send(); + } else if(err && _.isString(err.message) && err.message.startsWith('EUNFNTEX')) { + // If Skipper throws an EUNFNTEX error (a plaintext error thrown when a client never finishes streaming its request body), return a 408 (request timeout) response. + return res.status(408).send(); } else { sails.log.error('Sending 500 ("Server Error") response: \n', err); return res.status(500).send();