elysiajs / eden

Fully type-safe Elysia client
MIT License
147 stars 37 forks source link

fix: keep RequestInit for treaty2 and add tests #76

Closed hranum closed 4 months ago

hranum commented 5 months ago

Issue: https://github.com/elysiajs/elysia/issues/590

When using URL Endpoint with treaty2 the "fetch" object is being deleted for GET/HEAD requests and not passed to the fetcher.

https://github.com/elysiajs/eden/blob/dab2e53ac44539611b4545d3ee5ff937fa9f6b63/src/treaty2/index.ts#L204

This patch moves the RequestInit out of body and merges it with the "FetchRequestInit" object before "body" is deleted.

image