mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
framework: fix blob response (#1012)
This commit is contained in:
1 file changed
+1
-1
@@ -117,7 +117,7 @@ export default (logger, xff, xhost) => async (ctx: KoaContext, next: Next) => {
|
||||
ctx.response.status = 302;
|
||||
ctx.redirect(response.redirect);
|
||||
} else if (response.body) {
|
||||
ctx.body = response.body;
|
||||
ctx.body = response.body instanceof Blob ? Buffer.from(await response.body.arrayBuffer()) : response.body;
|
||||
ctx.response.status = response.status || 200;
|
||||
ctx.response.type = response.type
|
||||
|| (request.json
|
||||
|
||||
Reference in new issue
Block a user