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.
This commit is contained in:
Eric
2026-06-11 17:34:29 -05:00
committed by GitHub
parent 17d80dc654
commit c81284eea2
+3
View File
@@ -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();