Browse Source

fix: disable cors

NGPixel 4 years ago
parent
commit
c57c9d9018
2 changed files with 3 additions and 3 deletions
  1. 1 1
      server/core/servers.js
  2. 2 2
      server/master.js

+ 1 - 1
server/core/servers.js

@@ -130,7 +130,7 @@ module.exports = {
         path: '/graphql-subscriptions'
       }
     })
-    this.servers.graph.applyMiddleware({ app: WIKI.app })
+    this.servers.graph.applyMiddleware({ app: WIKI.app, cors: false })
   },
   /**
    * Close all active connections

+ 2 - 2
server/master.js

@@ -42,8 +42,8 @@ module.exports = async () => {
   // ----------------------------------------
 
   app.use(mw.security)
-  app.use(cors(WIKI.config.cors))
-  app.options('*', cors(WIKI.config.cors))
+  app.use(cors({ origin: false }))
+  app.options('*', cors({ origin: false }))
   if (WIKI.config.security.securityTrustProxy) {
     app.enable('trust proxy')
   }