فهرست منبع

remove redirection when the page is empty

yohei0125 3 سال پیش
والد
کامیت
dd062a90d1
1فایلهای تغییر یافته به همراه3 افزوده شده و 8 حذف شده
  1. 3 8
      packages/app/src/server/routes/page.js

+ 3 - 8
packages/app/src/server/routes/page.js

@@ -428,14 +428,9 @@ module.exports = function(crowi, app) {
 
 
     // empty page
     // empty page
     if (page.isEmpty) {
     if (page.isEmpty) {
-      // redirect to page (path) url
-      const url = new URL('https://dummy.origin');
-      url.pathname = page.path;
-      url.searchParams.append('originalEmptyPageId', page._id); // add this to distingish if user access the empty page intentionally
-      Object.entries(req.query).forEach(([key, value], i) => {
-        url.searchParams.append(key, value);
-      });
-      return res.safeRedirect(urljoin(url.pathname, url.search));
+      req.pageId = page._id;
+      req.pagePath = page.path;
+      return _notFound(req, res);
     }
     }
 
 
     const { path } = page; // this must exist
     const { path } = page; // this must exist