Nothing to see here, carry on.

This commit is contained in:
Sam Rose 2024-02-15 16:44:19 +00:00
parent 3dee8995be
commit dd4ea4be95
No known key found for this signature in database
1 changed files with 1 additions and 22 deletions

View File

@ -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
} }