@akinon/next 1.26.0-rc.7 → 1.26.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/middlewares/default.ts +14 -0
- package/middlewares/index.ts +1 -0
- package/middlewares/pretty-url.ts +2 -0
- package/package.json +1 -1
- package/types/index.ts +1 -0
package/CHANGELOG.md
CHANGED
package/middlewares/default.ts
CHANGED
|
@@ -153,6 +153,7 @@ const withPzDefault =
|
|
|
153
153
|
|
|
154
154
|
req.middlewareParams = {
|
|
155
155
|
commerceUrl,
|
|
156
|
+
found: true,
|
|
156
157
|
rewrites: {}
|
|
157
158
|
};
|
|
158
159
|
|
|
@@ -186,6 +187,19 @@ const withPzDefault =
|
|
|
186
187
|
locale.length ? `${locale}/` : ''
|
|
187
188
|
}${currency}${prettyUrl ?? pathnameWithoutLocale}`;
|
|
188
189
|
|
|
190
|
+
if (
|
|
191
|
+
!req.middlewareParams.found &&
|
|
192
|
+
Settings.customNotFoundEnabled
|
|
193
|
+
) {
|
|
194
|
+
let pathname = url.pathname
|
|
195
|
+
.replace(/\/+$/, '')
|
|
196
|
+
.split('/');
|
|
197
|
+
url.pathname = url.pathname.replace(
|
|
198
|
+
pathname.pop(),
|
|
199
|
+
'pz-not-found'
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
189
203
|
Settings.rewrites.forEach((rewrite) => {
|
|
190
204
|
url.pathname = url.pathname.replace(
|
|
191
205
|
rewrite.source,
|
package/middlewares/index.ts
CHANGED
package/package.json
CHANGED