@edgeone/opennextjs-pages 0.0.4 → 0.0.6

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.
@@ -254,7 +254,7 @@ var copyPrerenderedContent = async (ctx) => {
254
254
  // Parallel route default layout has no prerendered page
255
255
  case (meta.dataRoute?.endsWith("/default.rsc") && !existsSync(
256
256
  join(ctx.publishDir, "server/app", `${key}.html`)
257
- )):
257
+ ) || meta.initialRevalidateSeconds !== false):
258
258
  return;
259
259
  case meta.dataRoute?.endsWith(".json"):
260
260
  if (manifest.notFoundRoutes.includes(route)) {
@@ -17,7 +17,7 @@ var convertNextRoutePattern = (path2) => {
17
17
  const optionalCatchAllMatch = path2.match(/\[\[\.\.\.([^\]]+)\]\]/);
18
18
  if (optionalCatchAllMatch) {
19
19
  const paramName = optionalCatchAllMatch[1];
20
- convertedPath = convertedPath.replace(/\[\[\.\.\.([^\]]+)\]\]/g, `:${paramName}*?`);
20
+ convertedPath = convertedPath.replace(/\[\[\.\.\.([^\]]+)\]\]/g, `:${paramName}*`);
21
21
  }
22
22
  const catchAllMatch = path2.match(/\[\.\.\.([^\]]+)\]/);
23
23
  if (catchAllMatch) {
@@ -200,11 +200,14 @@ const server = createServer(async (req, res) => {
200
200
  const requestStartTime = Date.now();
201
201
 
202
202
  // 构造 handler 需要的 req 对象(可根据需要扩展)
203
+ // 用 eo-pages-host 替换 host
204
+ const originalHost = req.headers['eo-pages-host'] || req.headers['host'];
203
205
  const handlerReq = {
204
206
  ...req,
205
207
  headers: {
206
208
  ...req.headers,
207
209
  'accept-encoding': 'identity',
210
+ 'host': originalHost,
208
211
  },
209
212
  method: req.method,
210
213
  url: req.url,
@@ -197,16 +197,21 @@ const server = createServer(async (req, res) => {
197
197
  const requestStartTime = Date.now();
198
198
 
199
199
  // 构造 handler 需要的 req 对象(可根据需要扩展)
200
+ // 用 eo-pages-host 替换 host
201
+ const originalHost = req.headers['eo-pages-host'] || req.headers['host'];
200
202
  const handlerReq = {
201
203
  ...req,
202
204
  headers: {
203
205
  ...req.headers,
204
206
  'accept-encoding': 'identity',
207
+ 'host': originalHost,
205
208
  },
206
209
  method: req.method,
207
210
  url: req.url,
208
211
  };
209
212
 
213
+
214
+
210
215
  // 读取 body(如果有)
211
216
  // let body = [];
212
217
  // req.on('data', chunk => body.push(chunk));
@@ -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.0.4";
31
+ var version = "0.0.6";
32
32
 
33
33
  // src/run/handlers/tags-handler.cts
34
34
  var import_request_context = require("./request-context.cjs");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeone/opennextjs-pages",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",