getAll

Bun

Symbol

Headers.getAll

getAll(name: 'set-cookie' | 'Set-Cookie'): string[]

Get all headers matching the name

Only supports "Set-Cookie". All other headers are empty arrays.

@param name

The header name to get

@returns

An array of header values

const headers = new Headers();
headers.append("Set-Cookie", "foo=bar");
headers.append("Set-Cookie", "baz=qux");
headers.getAll("Set-Cookie"); // ["foo=bar", "baz=qux"]