Commit Detail
Commit cd3fdb3
Ask Claude to implement `encodeResponseBody: "manual"` option. The `Response` encoder has long had a non-standard option `encodeBody: "manual"` which says: "Do not automatically compress the body according to content-encoding; assume the bytes I provide are already compressed." However, this only allowed you to construct a `Response` to return with manual encoding. If you made at outgoing HTTP request, and the response was compressed, there was no way to stop the runtime from automatically decompressing it. This commit adds such a way: setting `encodeResponseBody: "manual"` as an option to `fetch()`. (Of course, `encodeResponseBody` is a non-standard option, but `encodeBody` is as well.) 🚨🚨 THIS PR WAS WRITTEN BY CLAUDE.AI 🚨🚨 (with a lot of prompting by me -- [see trascript](https://claude-workerd-transcript.pages.dev/)) This was an experiment to see how well Claude Code could handle the `workerd` codebase. Final stats: ``` Total cost: $9.77 Total duration (API): 17m 15.5s Total duration (wall): 1h 38m 26.7s ``` These numbers are... quite a bit larger than what I've seen when working with Claude Code on smaller, simpler projects. I am... not really sure I saved much time on the implementation itself, vs. writing it manually. But I am impressed that Claude figured it out! And I especially appreciated it writing the unit test because I hate writing tests.
Files changed
3 files changed~3 modified