Fix export dataset (#1436)

* fix: export dataset

* remove file buffer
This commit is contained in:
Archer
2024-05-10 16:15:23 +08:00
committed by GitHub
parent 435b2fba25
commit d70efe1d6f
3 changed files with 24 additions and 32 deletions

View File

@@ -13,7 +13,8 @@ export const NextAPI = (...args: NextApiHandler[]): NextApiHandler => {
response = await handler(req, res);
}
if (!res.writableFinished) {
const contentType = res.getHeader('Content-Type');
if ((!contentType || contentType === 'application/json') && !res.writableFinished) {
return jsonRes(res, {
code: 200,
data: response