response.clone() is used somewhere in the code and I think it would be helpful to pass the clone as response.
Previous implementation on Eden Treaty provided a getRaw flag to return the actual response without the body getting used. This way I was able to do await response.formData().
Right now the new Eden Treaty implementation only unwraps
application/json
andapplication/octet-stream
then falls back to parsing response.body as text. https://github.com/elysiajs/eden/blob/ead02aa927b806d6caf6f92a663f7ac2512845d9/src/treaty2/index.ts#L370-L405response.clone()
is used somewhere in the code and I think it would be helpful to pass the clone as response.Previous implementation on Eden Treaty provided a
getRaw
flag to return the actual response without the body getting used. This way I was able to doawait response.formData()
.Sample elysia endpoint:
Eden infers data to be a FormData:
But since treaty falls back to unwrapping response body as text. I get the form data boundaries as text:
![image](https://github.com/elysiajs/eden/assets/47680867/3c164c54-ee18-4a01-bf9a-08332d181c8a)