vite-plugin-rpx 0.11.38 → 0.11.40

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -23449,7 +23449,7 @@ function chunkedStream(pool, conn, closeConn, signal) {
23449
23449
  downstreamController?.close();
23450
23450
  } catch {}
23451
23451
  };
23452
- async function readLine() {
23452
+ async function readLine(allowCleanEof = false) {
23453
23453
  for (;; ) {
23454
23454
  for (let i2 = conn.pos;i2 + 1 < conn.len; i2++) {
23455
23455
  if (conn.buf[i2] === 13 && conn.buf[i2 + 1] === 10) {
@@ -23458,8 +23458,11 @@ function chunkedStream(pool, conn, closeConn, signal) {
23458
23458
  return line;
23459
23459
  }
23460
23460
  }
23461
- if (conn.closed)
23461
+ if (conn.closed) {
23462
+ if (allowCleanEof && conn.pos === conn.len)
23463
+ return null;
23462
23464
  throw new Error("upstream closed mid-chunk-header");
23465
+ }
23463
23466
  if (conn.len - conn.pos > MAX_HEADER_BYTES)
23464
23467
  throw new Error("upstream chunk header too large");
23465
23468
  await conn.waitForData(conn.len);
@@ -23499,7 +23502,13 @@ function chunkedStream(pool, conn, closeConn, signal) {
23499
23502
  await readLine();
23500
23503
  needTrailerCrlf = false;
23501
23504
  }
23502
- const sizeLine = await readLine();
23505
+ const sizeLine = await readLine(true);
23506
+ if (sizeLine === null) {
23507
+ pool.destroy(conn);
23508
+ cleanupSignal();
23509
+ controller.close();
23510
+ return;
23511
+ }
23503
23512
  const semi = sizeLine.indexOf(";");
23504
23513
  const size = Number.parseInt(semi === -1 ? sizeLine : sizeLine.slice(0, semi), 16);
23505
23514
  if (!Number.isInteger(size) || size < 0) {
@@ -26190,7 +26199,7 @@ init_utils();
26190
26199
  var package_default = {
26191
26200
  name: "@stacksjs/rpx",
26192
26201
  type: "module",
26193
- version: "0.11.38",
26202
+ version: "0.11.40",
26194
26203
  description: "A modern and smart reverse proxy.",
26195
26204
  author: "Chris Breuer <chris@stacksjs.org>",
26196
26205
  license: "MIT",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-rpx",
3
3
  "type": "module",
4
- "version": "0.11.38",
4
+ "version": "0.11.40",
5
5
  "description": "A modern and smart reverse proxy. Vite plugin.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "typecheck": "bunx tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@stacksjs/rpx": "0.11.38",
50
+ "@stacksjs/rpx": "0.11.40",
51
51
  "@stacksjs/tlsx": "^0.13.13"
52
52
  },
53
53
  "simple-git-hooks": {