fix: scrub set-cookie, alt-svc headers

deno deploy doesn't like alt-svc or set-cookie with the wrong domain (in this case, discord.com), and emits a warning every time
This commit is contained in:
shiftinv 2022-09-10 03:03:21 +02:00
parent 7b3bf8567d
commit e73128ddf3
1 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,11 @@ async function handleRequest(req: Request, connInfo: http.ConnInfo): Promise<Res
res.headers.set(`x-webhook-filter-${key}`, value);
}
// remove other headers that don't make sense here
for (const header of ["set-cookie", "alt-svc"]) {
res.headers.delete(header);
}
// log request
const respLen = res.headers.get("content-length") || 0;
const addr = connInfo.remoteAddr as Deno.NetAddr;