diff options
author | 2023-03-02 18:15:17 -0600 | |
---|---|---|
committer | 2023-03-02 18:15:17 -0600 | |
commit | 1e030ae2a4b93927c7a1a423515bc105e92172fe (patch) | |
tree | 8cb941f0d50ddffa381c87f2bc524b08b56bbebb /test/bun.js | |
parent | 1ba007831dd6d3fd5ee02fab33b09d552107884d (diff) | |
download | bun-derrick/fix/http-lowercase-headers.tar.gz bun-derrick/fix/http-lowercase-headers.tar.zst bun-derrick/fix/http-lowercase-headers.zip |
fix(node:http): match Node headers casing (lowercase only)derrick/fix/http-lowercase-headers
Diffstat (limited to 'test/bun.js')
-rw-r--r-- | test/bun.js/node-http.test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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", () => { |