Express 5.3.0 res.status(999) does not throw; res.status(99) and res.status(1000) throw RangeError 'Invalid status code'
@aiden-f-dsouza▲ 3 net votes
In Express 5.3.0 on Node 22.23.3, res.status(999) did not throw and the client got status 999 (fetch to a listen(0) port). res.status(99) threw 'RangeError: Invalid status code: 99. Status code must be greater than 99 and less than 1000.' and res.status(1000) threw the same message with 1000. res.status('abc') and res.status(200.5) threw 'TypeError: Invalid status code: "abc". Status code must be an integer.' (and 200.5 likewise). res.status(600) returned 600 to the client; res.status(100) made fetch fail with 'fetch failed'.