@modern-js/server-core 2.64.3 → 2.65.0

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.
@@ -41,7 +41,6 @@ var import_stream = require("./polyfills/stream");
41
41
  var import_polyfills = require("./polyfills");
42
42
  (0, import_install.installGlobals)();
43
43
  const createWebRequest = (req, res, body) => {
44
- var _req_url;
45
44
  const headerRecord = [];
46
45
  const len = req.rawHeaders.length;
47
46
  for (let i = 0; i < len; i += 2) {
@@ -58,11 +57,12 @@ const createWebRequest = (req, res, body) => {
58
57
  signal: controller.signal
59
58
  };
60
59
  res.on("close", () => controller.abort("res closed"));
61
- if (body || !(method === "GET" || method === "HEAD") && ((_req_url = req.url) === null || _req_url === void 0 ? void 0 : _req_url.includes("__loader")) || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
60
+ const url = `http://${req.headers.host}${req.url}`;
61
+ const fullUrl = new URL(url);
62
+ if (body || !(method === "GET" || method === "HEAD") && fullUrl.searchParams.has("__loader") || fullUrl.searchParams.has("__pass_body") || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
62
63
  init.body = body !== null && body !== void 0 ? body : (0, import_stream.createReadableStreamFromReadable)(req);
63
64
  init.duplex = "half";
64
65
  }
65
- const url = `http://${req.headers.host}${req.url}`;
66
66
  const request = new Request(url, init);
67
67
  return request;
68
68
  };
@@ -9,7 +9,6 @@ import { createReadableStreamFromReadable, writeReadableStreamToWritable } from
9
9
  import { writeReadableStreamToWritable as writeReadableStreamToWritable2 } from "./polyfills";
10
10
  installGlobals();
11
11
  var createWebRequest = function(req, res, body) {
12
- var _req_url;
13
12
  var headerRecord = [];
14
13
  var len = req.rawHeaders.length;
15
14
  for (var i = 0; i < len; i += 2) {
@@ -28,11 +27,12 @@ var createWebRequest = function(req, res, body) {
28
27
  res.on("close", function() {
29
28
  return controller.abort("res closed");
30
29
  });
31
- if (body || !(method === "GET" || method === "HEAD") && ((_req_url = req.url) === null || _req_url === void 0 ? void 0 : _req_url.includes("__loader")) || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
30
+ var url = "http://".concat(req.headers.host).concat(req.url);
31
+ var fullUrl = new URL(url);
32
+ if (body || !(method === "GET" || method === "HEAD") && fullUrl.searchParams.has("__loader") || fullUrl.searchParams.has("__pass_body") || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
32
33
  init.body = body !== null && body !== void 0 ? body : createReadableStreamFromReadable(req);
33
34
  init.duplex = "half";
34
35
  }
35
- var url = "http://".concat(req.headers.host).concat(req.url);
36
36
  var request = new Request(url, init);
37
37
  return request;
38
38
  };
@@ -5,7 +5,6 @@ import { createReadableStreamFromReadable, writeReadableStreamToWritable } from
5
5
  import { writeReadableStreamToWritable as writeReadableStreamToWritable2 } from "./polyfills";
6
6
  installGlobals();
7
7
  const createWebRequest = (req, res, body) => {
8
- var _req_url;
9
8
  const headerRecord = [];
10
9
  const len = req.rawHeaders.length;
11
10
  for (let i = 0; i < len; i += 2) {
@@ -22,11 +21,12 @@ const createWebRequest = (req, res, body) => {
22
21
  signal: controller.signal
23
22
  };
24
23
  res.on("close", () => controller.abort("res closed"));
25
- if (body || !(method === "GET" || method === "HEAD") && ((_req_url = req.url) === null || _req_url === void 0 ? void 0 : _req_url.includes("__loader")) || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
24
+ const url = `http://${req.headers.host}${req.url}`;
25
+ const fullUrl = new URL(url);
26
+ if (body || !(method === "GET" || method === "HEAD") && fullUrl.searchParams.has("__loader") || fullUrl.searchParams.has("__pass_body") || req.headers["x-mf-micro"] || req.headers["x-rsc-action"] || req.headers["x-parse-through-body"]) {
26
27
  init.body = body !== null && body !== void 0 ? body : createReadableStreamFromReadable(req);
27
28
  init.duplex = "half";
28
29
  }
29
- const url = `http://${req.headers.host}${req.url}`;
30
30
  const request = new Request(url, init);
31
31
  return request;
32
32
  };
@@ -5,6 +5,6 @@ export interface BffUserConfig {
5
5
  proxy?: Record<string, Options>;
6
6
  httpMethodDecider?: HttpMethodDecider;
7
7
  enableHandleWeb?: boolean;
8
- enableCrossProjectInvocation?: boolean;
8
+ crossProject?: boolean;
9
9
  }
10
10
  export type BffNormalizedConfig = BffUserConfig;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.64.3",
18
+ "version": "2.65.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -53,9 +53,9 @@
53
53
  "flatted": "^3.2.9",
54
54
  "hono": "^3.12.2",
55
55
  "ts-deepmerge": "7.0.2",
56
- "@modern-js/plugin": "2.64.3",
57
- "@modern-js/runtime-utils": "2.64.3",
58
- "@modern-js/utils": "2.64.3"
56
+ "@modern-js/plugin": "2.65.0",
57
+ "@modern-js/runtime-utils": "2.65.0",
58
+ "@modern-js/utils": "2.65.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/jest": "^29",
@@ -65,9 +65,9 @@
65
65
  "jest": "^29",
66
66
  "ts-jest": "^29.1.0",
67
67
  "typescript": "^5",
68
- "@modern-js/types": "2.64.3",
69
- "@scripts/build": "2.64.3",
70
- "@scripts/jest-config": "2.64.3"
68
+ "@modern-js/types": "2.65.0",
69
+ "@scripts/jest-config": "2.65.0",
70
+ "@scripts/build": "2.65.0"
71
71
  },
72
72
  "sideEffects": false,
73
73
  "publishConfig": {