We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
astro
0.0.0-rc-20220726043527
Node
npm
Windows
Sending a binary content is broken on api route.
Example request:
const requestBody = Uint8Array.from([0,1,33,233]) const response = await fetch("/api/echo", { method: "post", body: requestBody, headers: { "Content-Type": "application/octet-stream" } }); const responseBody = new Uint8Array(await response.arrayBuffer()) console.log(requestBody) console.log(responseBody)
Stdout:
Uint8Array(4) [ 0, 1, 33, 233 ] Uint8Array(6) [ 0, 1, 33, 239, 191, 189 ]
https://stackblitz.com/edit/github-xdurhs-q4pmtc
The text was updated successfully, but these errors were encountered:
I found PR #4023 that fixes empty body bug, but it seems to allow only UTF-8 contents.
astro/packages/astro/src/core/app/node.ts
Lines 25 to 57 in adf8cde
It always decodes a request body as UTF-8 string.
Sorry, something went wrong.
Ah yeah, it should be building up a Buffer I guess.
matthewp
Successfully merging a pull request may close this issue.
What version of
astro
are you using?0.0.0-rc-20220726043527
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the Bug
Sending a binary content is broken on api route.
Example request:
Stdout:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xdurhs-q4pmtc
Participation
The text was updated successfully, but these errors were encountered: