Merge branch 'type-worker-requests' of github.com:budibase/budibase into type-worker-requests
This commit is contained in:
commit
3dee8995be
|
@ -64,12 +64,7 @@ export function createRequest(request: Request): RequestInit {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
headers[header] = Array.isArray(value) ? value[0] : value
|
||||||
if (Array.isArray(value)) {
|
|
||||||
headers[header] = value[0]
|
|
||||||
} else {
|
|
||||||
headers[header] = value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// be specific about auth headers
|
// be specific about auth headers
|
||||||
const cookie = ctx.headers[constants.Header.COOKIE],
|
const cookie = ctx.headers[constants.Header.COOKIE],
|
||||||
|
@ -77,11 +72,9 @@ export function createRequest(request: Request): RequestInit {
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
headers[constants.Header.COOKIE] = cookie
|
headers[constants.Header.COOKIE] = cookie
|
||||||
} else if (apiKey) {
|
} else if (apiKey) {
|
||||||
if (Array.isArray(apiKey)) {
|
headers[constants.Header.API_KEY] = Array.isArray(apiKey)
|
||||||
headers[constants.Header.API_KEY] = apiKey[0]
|
? apiKey[0]
|
||||||
} else {
|
: apiKey
|
||||||
headers[constants.Header.API_KEY] = apiKey
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue