mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
74f92ac910
In Cloudflare Workers, Request.headers is immutable per the Fetch API spec. headersContextFromRequest was storing the original request.headers reference directly in HeadersContext, so when applyMiddlewareRequestHeaders later called ctx.headers.set() (to propagate middleware-modified headers like x-request-url into the server component context), Workers threw: TypeError: Can't modify immutable headers. Fix by wrapping with new Headers(request.headers), which creates an independent mutable copy while preserving all header values.