diff options
author | 2022-12-02 07:40:22 -0800 | |
---|---|---|
committer | 2022-12-02 07:42:44 -0800 | |
commit | d84f79bcc16d4e748c8a9400ea1cdb03d7f963fb (patch) | |
tree | 876d0a65d75c0f6aec97038e0d9f89c09f915c3f /src/bun.js/bindings/webcore/HTTPHeaderNames.h | |
parent | 917cbc8d5d0ea9446db66910be46b7fff4697304 (diff) | |
download | bun-d84f79bcc16d4e748c8a9400ea1cdb03d7f963fb.tar.gz bun-d84f79bcc16d4e748c8a9400ea1cdb03d7f963fb.tar.zst bun-d84f79bcc16d4e748c8a9400ea1cdb03d7f963fb.zip |
[fetch] Implement `Headers#getAll` and `Headers#getSetCookie()`
This matches Deno's behavior (get() combines, iterator preserves the order, set and append combine), but implements both the Cloudflare Workers `getAll()` and the potential standard `getSetCookie` function. The rationale for choosing both is to better support libraries which check for `getAll` and also because `getSetCookie` seems a little confusing (names are hard)
This also makes `.toJSON` and JSON.stringify return an array for `Set-Cookie`
Diffstat (limited to 'src/bun.js/bindings/webcore/HTTPHeaderNames.h')
-rw-r--r-- | src/bun.js/bindings/webcore/HTTPHeaderNames.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bun.js/bindings/webcore/HTTPHeaderNames.h b/src/bun.js/bindings/webcore/HTTPHeaderNames.h index 246afeefa..870c4980f 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderNames.h +++ b/src/bun.js/bindings/webcore/HTTPHeaderNames.h @@ -334,12 +334,11 @@ static StaticStringImpl* staticHeaderNames[] = { MAKE_STATIC_STRING_IMPL("x-xss-protection"), }; -static WTF::StaticStringImpl* httpHeaderNameStringImpl(WebCore::HTTPHeaderName headerName) { +static WTF::StaticStringImpl* httpHeaderNameStringImpl(WebCore::HTTPHeaderName headerName) +{ return staticHeaderNames[static_cast<size_t>(headerName)]; } - } // namespace WTF - #endif // HTTPHeaderNames_h |