mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
This commit is contained in:
1 parent
2f9c57a642
commit
c32feae8ef
18 files changed
+257
-59
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user