From 96dc0471ff8f830327ca89d6cbcdbd320b379b15 Mon Sep 17 00:00:00 2001
From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Date: Wed, 10 May 2023 16:55:13 -0700
Subject: Clean-up 85b4be5f7189e51e63672ddc874e7c6e09ae8bef
- We don't need to make `Bun__fetch` exported in every C++ header file
- We shouldn't return JSObjectRef, its an unnecessary wrapper
- The version of `fetch` on the Bun global should be non-configurable so that it is safe for anyone who wants to use that without a user-modifiable one
---
test/js/web/fetch/fetch.test.ts | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'test/js/web/fetch/fetch.test.ts')
diff --git a/test/js/web/fetch/fetch.test.ts b/test/js/web/fetch/fetch.test.ts
index 6e07db40b..9419629d1 100644
--- a/test/js/web/fetch/fetch.test.ts
+++ b/test/js/web/fetch/fetch.test.ts
@@ -1134,3 +1134,13 @@ it("#2794", () => {
expect(typeof globalThis.fetch.bind).toBe("function");
expect(typeof Bun.fetch.bind).toBe("function");
});
+
+it("invalid header doesnt crash", () => {
+ expect(() =>
+ fetch("http://example.com", {
+ headers: {
+ ["lol!!!!!" + "emoji" + "😀"]: "hello",
+ },
+ }),
+ ).toThrow();
+});
--
cgit v1.2.3
n-test-each'>bun-test-each
Unnamed repository; edit this file 'description' to name the repository.