(request: Request, env: Env, ctx: ExecutionContext)
| 518 | |
| 519 | function createSanitizedForwardRequest( |
| 520 | request: Request, |
| 521 | url: string | URL, |
| 522 | headers: Headers, |
| 523 | body?: BodyInit |
| 524 | ): Request { |
| 525 | const init: RequestInit & { duplex?: 'half' } = { |
| 526 | method: request.method, |
| 527 | headers, |
| 528 | }; |
| 529 | if ((body !== undefined || request.body) && requestMethodAllowsBody(request.method)) { |
| 530 | init.body = body ?? request.body; |
| 531 | init.duplex = 'half'; |
| 532 | } |
| 533 | return new Request(url, init); |
no test coverage detected