| 86 | } |
| 87 | |
| 88 | private intoImpitBody<TResponseType extends keyof ResponseTypes>( |
| 89 | body?: Exclude<HttpRequest<TResponseType>['body'], undefined>, |
| 90 | ): RequestInit['body'] { |
| 91 | if (isGeneratorObject(body)) { |
| 92 | return Readable.toWeb(Readable.from(body)) as any; |
| 93 | } |
| 94 | if (body instanceof Readable) { |
| 95 | return Readable.toWeb(body) as any; |
| 96 | } |
| 97 | |
| 98 | return body as any; |
| 99 | } |
| 100 | |
| 101 | private shouldRewriteRedirectToGet(httpStatus: number, method: HttpRequest<any>['method']): boolean { |
| 102 | // See https://github.com/mozilla-firefox/firefox/blob/911b3eec6c5e58a9a49e23aa105e49aa76e00f9c/netwerk/protocol/http/HttpBaseChannel.cpp#L4801 |