Skip to content

Commit

Permalink
audit fix
Browse files Browse the repository at this point in the history
- откат экспериментальных правок
  • Loading branch information
krutoo committed Jun 14, 2024
1 parent 2b05dfa commit 9507e2e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/http/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,7 @@ export const FetchUtil = {
/** @inheritdoc */
const parse = async (response: Response): Promise<T | null> => {
try {
const data: T = await parseBody(response);

// https://github.com/nodejs/undici/discussions/2979
if (response.body && !response.bodyUsed) {
try {
response.body.cancel();
} catch (error) {
// не делаем ничего если не смогли отменить
}
}

return data;
return await parseBody(response);
} catch {
return null;
}
Expand Down

0 comments on commit 9507e2e

Please sign in to comment.