feat: add status and headers overwrite for HandlerContext.render (#725)

This commit is contained in:
Leo Kettmeir
2023-05-31 10:09:53 +02:00
committed by GitHub
parent c172a70181
commit 060e2bb50d
5 changed files with 49 additions and 5 deletions
+14
View File
@@ -0,0 +1,14 @@
import { HandlerContext } from "$fresh/server.ts";
export default function Page() {
return <div>This is HTML</div>;
}
export const handler = {
GET(req: Request, { render }: HandlerContext) {
return render(undefined, {
status: 401,
headers: { "x-some-header": "foo" },
});
},
};