From 3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Fri, 29 Jun 2018 09:48:19 +0200
Subject: [PATCH] Do not enable cors twice on /api in test mode

---
 server.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server.ts b/server.ts
index 5511c54358..fffb8038f3 100644
--- a/server.ts
+++ b/server.ts
@@ -90,7 +90,8 @@ if (isTestInstance()) {
     // These routes have already cors
     if (
       req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 &&
-      req.path.indexOf(STATIC_PATHS.WEBSEED) === -1
+      req.path.indexOf(STATIC_PATHS.WEBSEED) === -1 &&
+      req.path.startsWith('/api/') === false
     ) {
       return (cors({
         origin: '*',
-- 
GitLab