mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
490e7405ef
* fix: preserve middleware request header deletions * test: refresh entry template snapshots * test: cover mixed-router middleware header overrides * fix: clone lazy headers by iteration * test: cover rewrite override serialization
35 lines
783 B
TypeScript
35 lines
783 B
TypeScript
type Props = {
|
|
authorization: string | null;
|
|
cookie: string | null;
|
|
middlewareHeader: string | null;
|
|
};
|
|
|
|
export async function getServerSideProps({
|
|
req,
|
|
}: {
|
|
req: { headers: Record<string, string | undefined> };
|
|
}) {
|
|
return {
|
|
props: {
|
|
authorization: req.headers.authorization ?? null,
|
|
cookie: req.headers.cookie ?? null,
|
|
middlewareHeader: req.headers["x-from-middleware"] ?? null,
|
|
} satisfies Props,
|
|
};
|
|
}
|
|
|
|
export default function PagesHeaderOverrideDeletePage({
|
|
authorization,
|
|
cookie,
|
|
middlewareHeader,
|
|
}: Props) {
|
|
return (
|
|
<main>
|
|
<h1>Pages Header Override Delete</h1>
|
|
<p id="authorization">{authorization}</p>
|
|
<p id="cookie">{cookie}</p>
|
|
<p id="middleware-header">{middlewareHeader}</p>
|
|
</main>
|
|
);
|
|
}
|