Просмотр исходного кода

Merge pull request #669 from weseek/fix/659-exclude-healthcheck-from-basic-auth

Exclude /_api/v3/healthcheck from basic authentication.
Yuki Takei 7 лет назад
Родитель
Сommit
2f09d0308f
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      src/server/crowi/express-init.js

+ 8 - 0
src/server/crowi/express-init.js

@@ -109,6 +109,14 @@ module.exports = function(crowi, app) {
       return next();
     }
 
+    // FIXME:
+    //   healthcheck endpoint exclude from basic authentication.
+    //   however, hard coding is not desirable.
+    //   need refactoring (ex. setting basic authentication for each routes)
+    if (req.path === '/_api/v3/healthcheck') {
+      return next();
+    }
+
     if (config.crowi['security:basicName'] && config.crowi['security:basicSecret']) {
       return basicAuth(
         config.crowi['security:basicName'],