Explorar o código

adjust showPageWithEndOfSlash

itizawa %!s(int64=5) %!d(string=hai) anos
pai
achega
5b0f3d5c26
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  1. 2 6
      src/server/routes/page.js

+ 2 - 6
src/server/routes/page.js

@@ -418,15 +418,11 @@ module.exports = function(crowi, app) {
   };
 
   /**
-   * switch action by behaviorType
+   * Redirect to the page without trailing slash
    */
-  /* eslint-disable no-else-return */
   actions.showPageWithEndOfSlash = function(req, res, next) {
-    const path = getPathFromRequest(req); // end of slash should be omitted
-    // redirect and showPage action will be triggered
-    return res.redirect(path);
+    return res.redirect(pathUtils.removeTrailingSlash(req.path));
   };
-  /* eslint-enable no-else-return */
 
   /**
    * switch action