mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. This PR migrates us to pnpm.
928 B
928 B
Interface: ModifiedRequest
Table of contents
Properties
Properties
headers
• Optional headers: Headers
If set, overwrites the incoming headers to the origin request.
This is useful when you want to pass data between a Middleware and a Serverless or Edge Function.
Example
import { rewrite } from '@vercel/edge';
export default async function middleware(request: Request): Promise<Response> {
const newHeaders = new Headers(request.headers);
newHeaders.set('x-user-id', 'user_123');
newHeaders.delete('authorization');
return rewrite(request.url, {
request: { headers: newHeaders },
});
}