nitro
nitro copied to clipboard
fix: encode buffer responses from cached event handler
๐ Linked issue
https://github.com/unjs/nitro/issues/1894
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Caching an endpoint that returns a buffer will break the endpoint. As an easy fix, we just base 64 encode whatever the result is and mark it as so.
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.