Fix proxy and split server into modules #1

Merged
probablycorey merged 18 commits from probablycorey/fix-proxy-404s into main 2026-03-11 16:35:00 +00:00
Showing only changes of commit 3fe4116ec7 - Show all commits

View File

@ -30,10 +30,12 @@ function proxyFetch(req: Request): Promise<Response> | Response {
}
const hasBody = req.method !== 'GET' && req.method !== 'HEAD'
const headers = new Headers(req.headers)
headers.delete('accept-encoding')
return fetch(`http://localhost${url.pathname}${url.search}`, {
method: req.method,
headers: req.headers,
headers,
body: hasBody ? req.body : undefined,
unix: SOCKET_PATH,
}).catch((e) => {