mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
@@ -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