(response: Response, body: BodyInit, method: string)
| 151 | } |
| 152 | |
| 153 | function cloneResponse(response: Response, body: BodyInit, method: string): Response { |
| 154 | const headers = new Headers(response.headers) |
| 155 | headers.set('Content-Encoding', method) |
| 156 | // The length changes after compression, let the runtime recompute it. |
| 157 | headers.delete('Content-Length') |
| 158 | |
| 159 | return new Response(body, { |
| 160 | status: response.status, |
| 161 | statusText: response.statusText, |
| 162 | headers, |
| 163 | }) |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Compresses an h3 v2 response value with [Zlib]{@link https://nodejs.org/api/zlib.html}. |
no outgoing calls
no test coverage detected