From 14935b2bc3a099d57ebf92f4c5ee54d406d03e50 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Wed, 18 Aug 2021 13:24:12 +0930 Subject: [PATCH] fix: allow localhost as CORS origin --- app/server.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/server.ts b/app/server.ts index cac550c21..ab04bcab9 100644 --- a/app/server.ts +++ b/app/server.ts @@ -90,6 +90,9 @@ const getAllowedOrigins = (): string[] => { // Only append the port if it's not HTTP/80 or HTTPS/443 return [...new Set([ + // Localhost - Used for GUI mode + `http://localhost${webuiHTTPPort ? `:${webuiHTTPPort}` : ''}`, + // IP `http://${localIp}${webuiHTTPPort ? `:${webuiHTTPPort}` : ''}`, `https://${localIp}${webuiHTTPSPort ? `:${webuiHTTPSPort}` : ''}`,