From fb313f210a51387fd77e0ddf4172ee3b52d0bdc9 Mon Sep 17 00:00:00 2001 From: Justin Whear Date: Fri, 17 Feb 2023 15:54:05 -0800 Subject: Fix #1602 (#2066) * initial test case * fix segfault from JSObjectMakeDeferredPromise * pass exceptions through from FetchHeader.createFromJS * not resolved, but getting close * implement review suggestions * fix exception check, tests * Change how header filtering is accomplished Previously the FetchHeaders implementation relied on converting names and values to IDLByteString to catch non-ASCII data, though not always reliably. This resulted in message-less TypeErrors when headers contained invalid characters. This commit shifts everything to IDLDOMString for the conversion and relies on the actual error checking in FetchHeaders.canWriteHeader, resulting in nicer error messages. To ensure that all headers are written as ASCII/UTF8 rather than UTF16, the copyTo bindings function checks the encoding and converts if necessary. * wrapping up FetchHeader fixes * since utf8 allocates only do so when needed * Update src/bun.js/bindings/bindings.cpp Co-authored-by: Jarred Sumner * WebCore__FetchHeaders__has should return on exception path * strip out log calls from test --------- Co-authored-by: Jarred Sumner --- src/bun.js/bindings/headers-cpp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bun.js/bindings/headers-cpp.h') diff --git a/src/bun.js/bindings/headers-cpp.h b/src/bun.js/bindings/headers-cpp.h index d0abc7db0..c57c65e18 100644 --- a/src/bun.js/bindings/headers-cpp.h +++ b/src/bun.js/bindings/headers-cpp.h @@ -1,4 +1,4 @@ -//-- AUTOGENERATED FILE -- 1676470760 +//-- AUTOGENERATED FILE -- 1676656020 // clang-format off #pragma once -- cgit v1.2.3