From ed68c614f26e954059f606a4d64fb03fbe5fbdbd Mon Sep 17 00:00:00 2001 From: Adim Victor Date: Wed, 21 Nov 2018 07:30:23 -0800 Subject: [PATCH] Update response.send() to check HTTP status code length I updated line 300 which checks that the HTTP status code passed into the Response.send() function is of type "number" to also check that the length of the status code is equal to three since all HTTP status codes are three digits. This allows for the Response.send() function to send ordinary numbers of any length ( other than three ) as response if need be. --- lib/response.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index 96d22bf47..b36e57c8a 100644 --- a/lib/response.js +++ b/lib/response.js @@ -297,7 +297,7 @@ function patch(Response) { var self = this; var sendArgs; - if (typeof code === 'number') { + if (typeof code === 'number' && String(code).length === 3) { sendArgs = { code: code, body: body,