Fix session creation error handling and health endpoint status codes (#177) (#179)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-04-05 09:07:34 -04:00
1 parent 2f9c57a642
commit c32feae8ef
18 files changed
+257 -59

No files matched your search

+8 -4
View File
@@ -118,13 +118,15 @@ export async function proxyRequest(request: Request) {
})
const responseHeaders: Record<string, string> = {}
const skipHeaders = new Set(['connection', 'transfer-encoding', 'content-encoding', 'content-length'])
response.headers.forEach((value, key) => {
if (!['connection', 'transfer-encoding'].includes(key.toLowerCase())) {
if (!skipHeaders.has(key.toLowerCase())) {
responseHeaders[key] = value
}
})
return new Response(response.body, {
const body = await response.text()
return new Response(body, {
status: response.status,
statusText: response.statusText,
headers: responseHeaders,
@@ -159,13 +161,15 @@ export async function proxyToOpenCodeWithDirectory(
})
const responseHeaders: Record<string, string> = {}
const skipHeaders = new Set(['connection', 'transfer-encoding', 'content-encoding', 'content-length'])
response.headers.forEach((value, key) => {
if (!['connection', 'transfer-encoding'].includes(key.toLowerCase())) {
if (!skipHeaders.has(key.toLowerCase())) {
responseHeaders[key] = value
}
})
return new Response(response.body, {
const responseBody = await response.text()
return new Response(responseBody, {
status: response.status,
statusText: response.statusText,
headers: responseHeaders,