浏览代码

Allows running without requiring Google Safe Browsing. Useful for running internally, with API methods not publicly exposed.

Shane Holland 7 年之前
父节点
当前提交
e07e7093b5
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      server/server.js

+ 5 - 2
server/server.js

@@ -104,8 +104,11 @@ app.prepare().then(() => {
     auth.authJwtLoose,
     catchErrors(auth.recaptcha),
     catchErrors(validateUrl),
-    catchErrors(cooldownCheck),
-    catchErrors(malwareCheck),
+    /* Allows running without Google Safe Browsing enabled */
+    config.GOOGLE_SAFE_BROWSING_KEY
+      ? [ catchErrors(cooldownCheck),
+          catchErrors(malwareCheck) ]
+      : [],
     catchErrors(url.urlShortener)
   );
   server.post('/api/url/deleteurl', auth.authApikey, auth.authJwt, catchErrors(url.deleteUrl));