Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning ArrayBuffer returns empty JSON object #931

Open
MickL opened this issue Dec 10, 2024 · 0 comments
Open

Returning ArrayBuffer returns empty JSON object #931

MickL opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MickL
Copy link

MickL commented Dec 10, 2024

Environment

H3: 1.13.1-20241208-012300-10e98be

Describe the bug

From unjs/unstorage#519

Returning an ArrayBuffer in an event handler seems to set response body to an empty JSON object. At least it does with unstorage and Cloudflare D2:

import { defineEventHandler } from 'h3';
import { useStorage } from 'nitro/runtime';

export default defineEventHandler(async (event) => {
  return useStorage('files').getItemRaw('some-key');
});
@MickL MickL added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant