@edgeone/opennextjs-pages 0.2.9 → 0.2.10
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.
|
@@ -3667,8 +3667,13 @@ function matchesPath(pathname, matcher) {
|
|
|
3667
3667
|
* @param {Request} request - \u539F\u59CB\u8BF7\u6C42\u5BF9\u8C61
|
|
3668
3668
|
* @returns {Promise<Response|null|{__rewrite: string}>} - \u4E2D\u95F4\u4EF6\u5904\u7406\u540E\u7684\u54CD\u5E94\uFF0Cnull \u8868\u793A\u4E0D\u5904\u7406
|
|
3669
3669
|
*/
|
|
3670
|
-
async function executeMiddleware({request}) {
|
|
3670
|
+
async function executeMiddleware({request, env}) {
|
|
3671
3671
|
try {
|
|
3672
|
+
// \u6CE8\u5165\u73AF\u5883\u53D8\u91CF
|
|
3673
|
+
if (env && typeof process !== 'undefined' && process.env) {
|
|
3674
|
+
Object.assign(process.env, env);
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3672
3677
|
const url = new URL(request.url);
|
|
3673
3678
|
const pathname = url.pathname;
|
|
3674
3679
|
|
|
@@ -44,7 +44,12 @@ function convertEoGeoToNextGeo(eoGeo) {
|
|
|
44
44
|
* @param {Request} request - \u539F\u59CB\u8BF7\u6C42\u5BF9\u8C61
|
|
45
45
|
* @returns {Promise<any>} - middleware \u51FD\u6570\u7684\u539F\u59CB\u8FD4\u56DE\u503C
|
|
46
46
|
*/
|
|
47
|
-
async function executeMiddleware({request}) {
|
|
47
|
+
async function executeMiddleware({request, env}) {
|
|
48
|
+
// \u6CE8\u5165\u73AF\u5883\u53D8\u91CF
|
|
49
|
+
if (env && typeof process !== 'undefined' && process.env) {
|
|
50
|
+
Object.assign(process.env, env);
|
|
51
|
+
}
|
|
52
|
+
|
|
48
53
|
// \u68C0\u67E5 middleware \u51FD\u6570\u662F\u5426\u5B58\u5728
|
|
49
54
|
if (typeof middleware !== 'function') {
|
|
50
55
|
throw new Error('middleware function not found');
|
|
@@ -348,7 +353,12 @@ function convertEoGeoToNextGeo(eoGeo) {
|
|
|
348
353
|
* @param {Request} request - \u539F\u59CB\u8BF7\u6C42\u5BF9\u8C61
|
|
349
354
|
* @returns {Promise<any>} - middleware \u51FD\u6570\u7684\u539F\u59CB\u8FD4\u56DE\u503C
|
|
350
355
|
*/
|
|
351
|
-
async function executeMiddleware({request}) {
|
|
356
|
+
async function executeMiddleware({request, env}) {
|
|
357
|
+
// \u6CE8\u5165\u73AF\u5883\u53D8\u91CF
|
|
358
|
+
if (env && typeof process !== 'undefined' && process.env) {
|
|
359
|
+
Object.assign(process.env, env);
|
|
360
|
+
}
|
|
361
|
+
|
|
352
362
|
const url = new URL(request.url);
|
|
353
363
|
const pathname = url.pathname;
|
|
354
364
|
|
|
@@ -3147,7 +3147,9 @@ var server_default = async (request, _context, topLevelSpan, requestContext) =>
|
|
|
3147
3147
|
port: Number(url.port) || 443,
|
|
3148
3148
|
hostname: url.hostname,
|
|
3149
3149
|
dir: process.cwd(),
|
|
3150
|
-
isDev: false
|
|
3150
|
+
isDev: false,
|
|
3151
|
+
// 让 Next.js router-server 跳过 middleware 分派
|
|
3152
|
+
minimalMode: true
|
|
3151
3153
|
});
|
|
3152
3154
|
});
|
|
3153
3155
|
}
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(tags_handler_exports);
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var name = "@edgeone/opennextjs-pages";
|
|
31
|
-
var version = "0.2.
|
|
31
|
+
var version = "0.2.10";
|
|
32
32
|
|
|
33
33
|
// src/run/handlers/tags-handler.cts
|
|
34
34
|
var import_request_context = require("./request-context.cjs");
|