From 1e030ae2a4b93927c7a1a423515bc105e92172fe Mon Sep 17 00:00:00 2001 From: Derrick Farris Date: Thu, 2 Mar 2023 18:15:17 -0600 Subject: fix(node:http): match Node headers casing (lowercase only) --- test/bun.js/node-http.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/bun.js/node-http.test.ts') diff --git a/test/bun.js/node-http.test.ts b/test/bun.js/node-http.test.ts index 7818fba62..c6d44f47d 100644 --- a/test/bun.js/node-http.test.ts +++ b/test/bun.js/node-http.test.ts @@ -411,6 +411,15 @@ describe("node:http", () => { req.end(); } }); + + it("should allow us to access headers on response object in lower-case", done => { + const req = request(`http://localhost:${serverPort}`, { method: "POST" }, res => { + expect(res.rawHeaders.indexOf("Content-Type")).toBeTruthy(); + expect(res.headers["content-type"]).toBe("text/plain"); + done(); + }); + req.end(); + }); }); describe("signal", () => { -- cgit v1.2.3