closes #2346 The primary issue was the snippet `headers[key] = value`. This caused only one `set-cookie` to make it through. Switching to a `Headers` object allowed me to use `append` when appropriate, allowing for multiple `set-cookie` entries. I also cleaned up one of the tests to make use of steps, because I originally broke it and couldn't immediately tell which part was failing.
19 lines
408 B
TypeScript
19 lines
408 B
TypeScript
import { FreshContext, Handlers } from "$fresh/server.ts";
|
|
|
|
export const handler: Handlers = {
|
|
async GET(_req: Request, ctx: FreshContext) {
|
|
const headers = new Headers();
|
|
headers.append("Set-Cookie", "foo=bar");
|
|
headers.append("Set-Cookie", "baz=1234");
|
|
return await ctx.render({}, { headers });
|
|
},
|
|
};
|
|
|
|
export default function Home() {
|
|
return (
|
|
<div>
|
|
hello
|
|
</div>
|
|
);
|
|
}
|