From 0f00f222122a4fb06d43d64446df8607988317d1 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Wed, 15 Feb 2023 13:40:52 +0100 Subject: [PATCH] fix(web): remove link header causing 502 errors (#1765) --- web/src/hooks.server.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/hooks.server.ts b/web/src/hooks.server.ts index 0ed93b7b9e..e50560cc36 100644 --- a/web/src/hooks.server.ts +++ b/web/src/hooks.server.ts @@ -2,7 +2,13 @@ import type { Handle, HandleServerError } from '@sveltejs/kit'; import { AxiosError } from 'axios'; export const handle: Handle = async ({ event, resolve }) => { - return await resolve(event); + const res = await resolve(event); + + // The link header can grow quite big and has caused issues with our nginx + // proxy returning a 502 Bad Gateway error. Therefore the header gets deleted. + res.headers.delete('Link'); + + return res; }; export const handleError: HandleServerError = async ({ error }) => {