From 362684505177e8edf8f8231bfe2f824c8ab28090 Mon Sep 17 00:00:00 2001 From: Derrick Farris Date: Fri, 3 Mar 2023 23:08:26 -0600 Subject: fix(node:http): match Node headers casing (lowercase only) (#2288) * fix(node:http): match Node headers casing (lowercase only) * fix(JSFetchHeaders): `WTFMove` the ascii string --- test/bun.js/fetch_headers.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/bun.js/fetch_headers.test.js') diff --git a/test/bun.js/fetch_headers.test.js b/test/bun.js/fetch_headers.test.js index 2e5b9fa52..cd2786c08 100644 --- a/test/bun.js/fetch_headers.test.js +++ b/test/bun.js/fetch_headers.test.js @@ -46,6 +46,18 @@ describe("Headers", async () => { // This would hang expect(await fetchContent({ "x-test": origString })).toBe(origString); }); + + describe("toJSON()", () => { + it("should provide lowercase header names", () => { + const headers1 = new Headers({ "X-Test": "yep", "Content-Type": "application/json" }); + expect(headers1.toJSON()).toEqual({ "x-test": "yep", "content-type": "application/json" }); + + const headers2 = new Headers(); + headers2.append("X-Test", "yep"); + headers2.append("Content-Type", "application/json"); + expect(headers2.toJSON()).toEqual({ "x-test": "yep", "content-type": "application/json" }); + }); + }); }); async function fetchContent(headers) { -- cgit v1.2.3 alue='ciro/fix-test-command'>ciro/fix-test-command Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/JSDOMWrapper.h (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-02-13fix(FormData): make String explicit, thanks @dylan-conway (#2065)Gravatar Derrick Farris 1-1/+1
2023-02-13fix(FormData): add string literal operator (#2064)Gravatar Derrick Farris 1-2/+2
2023-02-13Add pretty printer for FormDataGravatar Jarred Sumner 5-1/+101
2023-02-13Add dynamic port assigning to Bun.serve (#2062)Gravatar MichaƂ Warda 3-5/+40
2023-02-13feat(napi): add `napi_get_value_bigint_words` (#2061)Gravatar Derrick Farris 3-0/+44
2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 8-1/+148