From 57819f2d5cee231a081d31f00f745df14e69ed1f Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Mon, 20 Jan 2025 19:11:27 +0100 Subject: [PATCH] Added Uint8Array test with encoding --- test/res.send.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/res.send.js b/test/res.send.js index 860607c49b..78a69a5c66 100644 --- a/test/res.send.js +++ b/test/res.send.js @@ -177,6 +177,19 @@ describe('res', function(){ .expect(200, 'hey', done); }) + it('should accept Uint8Array', function(done){ + var app = express(); + app.use(function(req, res){ + const encodedHey = new TextEncoder().encode("hey"); + res.set("Content-Type", "text/plain").send(encodedHey); + }) + + request(app) + .get("/") + .expect("Content-Type", "text/plain; charset=utf-8") + .expect(200, "hey", done); + }) + it('should not override ETag', function (done) { var app = express()