Procházet zdrojové kódy

fix(web): remove link header causing 502 errors (#1765)

Michel Heusschen před 2 roky
rodič
revize
0f00f22212
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      web/src/hooks.server.ts

+ 7 - 1
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 }) => {