@netlify/plugin-nextjs 5.9.2 → 5.9.3
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.
|
@@ -203,7 +203,7 @@ var import_constants = require("next/dist/lib/constants.js");
|
|
|
203
203
|
|
|
204
204
|
// package.json
|
|
205
205
|
var name = "@netlify/plugin-nextjs";
|
|
206
|
-
var version = "5.9.
|
|
206
|
+
var version = "5.9.3";
|
|
207
207
|
|
|
208
208
|
// src/shared/cache-types.cts
|
|
209
209
|
var isCachedPageValue = (value) => value.kind === "PAGE" || value.kind === "PAGES";
|
|
@@ -68868,7 +68868,7 @@ var import_sdk_trace_node = __toESM(require_src20(), 1);
|
|
|
68868
68868
|
var import_semantic_conventions = __toESM(require_src(), 1);
|
|
68869
68869
|
var {
|
|
68870
68870
|
default: { version, name }
|
|
68871
|
-
} = await import("../../esm-chunks/package-
|
|
68871
|
+
} = await import("../../esm-chunks/package-MI2MBCHL.js");
|
|
68872
68872
|
var sdk = new import_sdk_node.NodeSDK({
|
|
68873
68873
|
resource: new import_resources.Resource({
|
|
68874
68874
|
[import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: name,
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
normalizeLocalePath,
|
|
15
15
|
normalizeTrailingSlash,
|
|
16
16
|
relativizeURL,
|
|
17
|
+
removeBasePath,
|
|
18
|
+
rewriteDataPath,
|
|
17
19
|
} from './util.ts'
|
|
18
20
|
|
|
19
21
|
export interface FetchEventResult {
|
|
@@ -180,14 +182,16 @@ export const buildResponse = async ({
|
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
if (isDataReq) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
rewriteUrl.pathname = rewriteDataPath({
|
|
186
|
+
dataUrl: new URL(request.url).pathname,
|
|
187
|
+
newRoute: removeBasePath(rewriteUrl.pathname, nextConfig?.basePath),
|
|
188
|
+
basePath: nextConfig?.basePath,
|
|
189
|
+
})
|
|
190
|
+
} else {
|
|
191
|
+
// respect trailing slash rules to prevent 308s
|
|
192
|
+
rewriteUrl.pathname = normalizeTrailingSlash(rewriteUrl.pathname, nextConfig?.trailingSlash)
|
|
186
193
|
}
|
|
187
194
|
|
|
188
|
-
// respect trailing slash rules to prevent 308s
|
|
189
|
-
rewriteUrl.pathname = normalizeTrailingSlash(rewriteUrl.pathname, nextConfig?.trailingSlash)
|
|
190
|
-
|
|
191
195
|
const target = normalizeLocalizedTarget({ target: rewriteUrl.toString(), request, nextConfig })
|
|
192
196
|
if (target === request.url) {
|
|
193
197
|
logger.withFields({ rewrite_url: rewrite }).debug('Rewrite url is same as original url')
|