mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
@@ -91,7 +91,7 @@
|
||||
"discord-api-types": "^0.37.119",
|
||||
"magic-bytes.js": "^1.10.0",
|
||||
"tslib": "^2.8.1",
|
||||
"undici": "6.21.1",
|
||||
"undici": "7.8.0",
|
||||
"uuid": "^11.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { STATUS_CODES } from 'node:http';
|
||||
import { URLSearchParams } from 'node:url';
|
||||
import { types } from 'node:util';
|
||||
import { type RequestInit, request, Headers } from 'undici';
|
||||
import type { HeaderRecord } from 'undici/types/header.js';
|
||||
import type { ResponseLike } from '../shared.js';
|
||||
|
||||
export type RequestOptions = Exclude<Parameters<typeof request>[1], undefined>;
|
||||
@@ -28,7 +29,7 @@ export async function makeRequest(url: string, init: RequestInit): Promise<Respo
|
||||
get bodyUsed() {
|
||||
return res.body.bodyUsed;
|
||||
},
|
||||
headers: new Headers(res.headers as Record<string, string[] | string>),
|
||||
headers: new Headers(res.headers as HeaderRecord),
|
||||
status: res.statusCode,
|
||||
statusText: STATUS_CODES[res.statusCode]!,
|
||||
ok: res.statusCode >= 200 && res.statusCode < 300,
|
||||
|
||||
Reference in New Issue
Block a user