fix(rest): set the correct auth header when using proxy (#2969)

This commit is contained in:
ITOH
2023-04-04 22:24:20 +00:00
committed by GitHub
parent f8afb94aa0
commit 927ee42ce0
+6
View File
@@ -402,6 +402,12 @@ export function createRestManager(options: CreateRestManagerOptions): RestManage
async makeRequest(method, route, options) {
if (rest.isProxied) {
if (rest.authorization !== undefined) {
options ??= {}
options.headers ??= {}
options.headers.authorization = rest.authorization
}
const result = await fetch(`${rest.baseUrl}/v${rest.version}${route}`, rest.createRequestBody(method, options))
if (!result.ok) {