Skip to content

High performance self-hosted photo and video management solution.

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

Michel Heusschen0f00f222122a
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 }) => {