This commit is contained in:
MomentQYC 2024-10-04 23:46:39 +08:00
parent 73ae524e9c
commit 0356af4175
5 changed files with 39 additions and 23 deletions

View file

@ -99,8 +99,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
timeout: 60000,
});
let contentType = res.headers.get('content-type') || 'application/octet-stream';
if (res.headers.get('content-type') === 'audio/flac') {
return res.body;
return {
body: res.body,
headers: {
'Content-Type': contentType,
}
};
} else {
throw new ApiError(meta.errors.unavailable);
}