Nothing to see here, carry on.
This commit is contained in:
parent
3dee8995be
commit
dd4ea4be95
|
@ -17,28 +17,6 @@ import {
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
import { Ctx, User, EmailInvite } from "@budibase/types"
|
import { Ctx, User, EmailInvite } from "@budibase/types"
|
||||||
|
|
||||||
function ensureHeadersIsObject(headers: HeadersInit | undefined): Headers {
|
|
||||||
if (headers instanceof Headers) {
|
|
||||||
return headers
|
|
||||||
}
|
|
||||||
|
|
||||||
const headersObj = new Headers()
|
|
||||||
if (headers === undefined) {
|
|
||||||
return headersObj
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Array.isArray(headers)) {
|
|
||||||
for (const [key, value] of headers) {
|
|
||||||
headersObj.append(key, value)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (const key in headers) {
|
|
||||||
headersObj.append(key, headers[key])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return headersObj
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Request {
|
interface Request {
|
||||||
ctx?: Ctx
|
ctx?: Ctx
|
||||||
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"
|
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"
|
||||||
|
@ -89,6 +67,7 @@ export function createRequest(request: Request): RequestInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
logging.correlation.setHeader(headers)
|
logging.correlation.setHeader(headers)
|
||||||
|
requestInit.headers = headers
|
||||||
return requestInit
|
return requestInit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue