@deepseek-ai/dsh-host-webserver 0.1.6-alpha.1 → 0.1.7-alpha.1

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.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/host/webserver/README.md
5
- README.md: df1881a3a16b69f61127956127c7806c70793f91
6
- README.zh.md: 1d07d43ac97c616c9b7450da71ad09cb55fa4267
5
+ README.md: 9dd698404719eecdf9fb4c40720ccc74ab37be9d
6
+ README.zh.md: d4701b79e432dfa3e8ba8485f8644758ec3b34d7
package/README.md CHANGED
@@ -38,7 +38,7 @@ Compose the webserver as the HTTP transport of a browser-facing host, then let t
38
38
 
39
39
  `host` accepts exactly two values: `127.0.0.1` (default posture, loopback only) and `0.0.0.0` (deliberate network exposure — the server carries no TLS, authentication, or origin policy of its own). `port` 0 requests an OS-assigned port; `ctx.webServer.port` reads the listening port afterwards.
40
40
 
41
- Set `compression: 'gzip'` to wrap eligible socket-backed responses without changing route APIs. The client must accept gzip and the media type must be compressible; known response lengths below `compressionThresholdBytes` remain uncompressed, while unknown-length streams are eligible immediately. Existing encodings, `Cache-Control: no-transform`, range responses, SSE, ZIP, and the packaged `.gz` Worker image remain unchanged. The shipped Web bundle uses compression level 1 with a 1024-byte threshold; other compositions default to no compression.
41
+ Set `compression: 'gzip'` to wrap eligible socket-backed responses without changing route APIs. The client must accept gzip and the media type must be compressible or `multipart/form-data`; known response lengths below `compressionThresholdBytes` remain uncompressed, while unknown-length streams are eligible immediately. Existing encodings, `Cache-Control: no-transform`, range responses, SSE, ZIP, and the packaged `.gz` Worker image remain unchanged. The shipped Web bundle uses compression level 1 with a 1024-byte threshold; other compositions default to no compression.
42
42
 
43
43
  ### Registering routes
44
44
 
package/README.zh.md CHANGED
@@ -38,7 +38,7 @@ kind: "package-reference"
38
38
 
39
39
  `host` 只接受两个值:`127.0.0.1`(默认姿态,仅回环)与 `0.0.0.0`(有意向网络开放——服务器自身不携带 TLS、认证或来源策略)。`port` 为 0 时请求 OS 分配端口;之后用 `ctx.webServer.port` 读取正在监听的端口。
40
40
 
41
- 设置 `compression: 'gzip'` 可以包装符合条件的 socket-backed 响应,而不改变 route API。客户端必须接受 gzip,且媒体类型必须可压缩;已知长度小于 `compressionThresholdBytes` 的响应保持未压缩,未知长度的流则立即符合条件。已有编码、`Cache-Control: no-transform`、range 响应、SSE(Server-Sent Events)、ZIP 与已打包的 `.gz` Worker image 均保持不变。随附 Web bundle 使用 level 1 与 1024 字节阈值;其他组合默认不压缩。
41
+ 设置 `compression: 'gzip'` 可以包装符合条件的 socket-backed 响应,而不改变 route API。客户端必须接受 gzip,且媒体类型必须可压缩或为 `multipart/form-data`;已知长度小于 `compressionThresholdBytes` 的响应保持未压缩,未知长度的流则立即符合条件。已有编码、`Cache-Control: no-transform`、range 响应、SSE(Server-Sent Events)、ZIP 与已打包的 `.gz` Worker image 均保持不变。随附 Web bundle 使用 level 1 与 1024 字节阈值;其他组合默认不压缩。
42
42
 
43
43
  ### 注册路由
44
44
 
package/lib/index.js CHANGED
@@ -111,6 +111,7 @@ function createGzipMiddleware(config) {
111
111
  if (response.getHeader("content-range") !== void 0) return false;
112
112
  const contentType = response.getHeader("content-type");
113
113
  if (typeof contentType === "string" && contentType.toLowerCase().startsWith("text/event-stream")) return false;
114
+ if (typeof contentType === "string" && /^multipart\/form-data(?:;|$)/i.test(contentType)) return true;
114
115
  return compressionMiddleware.filter(request, response);
115
116
  }
116
117
  });
@@ -26,7 +26,7 @@ export type IndexInjection =
26
26
  /**
27
27
  * External classic script, executed in table order: a parser-blocking tag
28
28
  * when served, an awaited fetch-and-execute in the worker form (whose
29
- * loader resolves worker-only URLs such as `/plugins/...`).
29
+ * loader resolves worker-only references such as `plugins/...`).
30
30
  */
31
31
  | {
32
32
  kind: 'script-src';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-host-webserver",
3
3
  "description": "Web route-registration plugin: HTTP and upgrade routes, index transform taps, and static dist fallback; knows no harness concepts",
4
- "version": "0.1.6-alpha.1",
4
+ "version": "0.1.7-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,16 +27,16 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/cordis": "^4.0.2"
30
+ "@deepseek-ai/cordis": "^4.0.3"
31
31
  },
32
32
  "dependencies": {
33
33
  "compression": "^1.8.1",
34
34
  "negotiator": "^1.0.0",
35
- "@deepseek-ai/schemastery": "^3.18.2"
35
+ "@deepseek-ai/schemastery": "^3.18.3"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/compression": "^1.8.1",
39
39
  "@types/negotiator": "^0.6.5",
40
- "@deepseek-ai/cordis": "^4.0.2"
40
+ "@deepseek-ai/cordis": "^4.0.3"
41
41
  }
42
42
  }