unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
444 stars 22 forks source link

feat: support returning raw body for binary content-types #43

Closed danielroe closed 2 years ago

danielroe commented 2 years ago

related downstream issue: https://github.com/unjs/nitro/issues/100

mariocesar commented 2 years ago

FYI, if this and https://github.com/unjs/nitro/pull/320 is merged it will enable to deploy Nuxt.js to AWS Lambda

pi0 commented 2 years ago

Let's return _data as is and let the upper layer (fetch) or direct use intercept the body type. It has to be a breaking change but seems better fix to not assume type of _data (technically for node polyfill it should be buffer or string but we set it as is there too)