Fix proxy and split server into modules #1
|
|
@ -38,6 +38,11 @@ function proxyFetch(req: Request): Promise<Response> | Response {
|
|||
headers,
|
||||
body: hasBody ? req.body : undefined,
|
||||
unix: SOCKET_PATH,
|
||||
}).then((r) => {
|
||||
const respHeaders = new Headers(r.headers)
|
||||
respHeaders.delete('content-encoding')
|
||||
respHeaders.delete('content-length')
|
||||
return new Response(r.body, { status: r.status, headers: respHeaders })
|
||||
}).catch((e) => {
|
||||
console.error('Proxy error:', e)
|
||||
return new Response('Tronbyt server is not responding', { status: 502 })
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user