ai 6.0.205 → 6.0.207
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/CHANGELOG.md +20 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +2 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +3 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/util/download/download.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.207
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 779f5cd: fix(provider-utils): cancel response body on download rejection to prevent socket leak
|
|
8
|
+
|
|
9
|
+
When a download was rejected early — because the `Content-Length` header exceeded the size limit, the response status was not ok, or a redirect resolved to a blocked URL — the fetch response body was left unconsumed and uncancelled. With WHATWG Fetch/undici this leaves the underlying TCP socket open instead of returning it to the connection pool, allowing an attacker-controlled origin to exhaust file descriptors and cause a denial of service. The body is now cancelled on all early-rejection paths in `readResponseWithSizeLimit`, `download`, and `downloadBlob`, and `fetchWithValidatedRedirects` cancels each redirect hop's body before following or rejecting the next hop.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [5bfde36]
|
|
12
|
+
- Updated dependencies [779f5cd]
|
|
13
|
+
- @ai-sdk/gateway@3.0.133
|
|
14
|
+
- @ai-sdk/provider-utils@4.0.30
|
|
15
|
+
|
|
16
|
+
## 6.0.206
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [e962dda]
|
|
21
|
+
- @ai-sdk/gateway@3.0.132
|
|
22
|
+
|
|
3
23
|
## 6.0.205
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ function detectMediaType({
|
|
|
1281
1281
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
1282
1282
|
|
|
1283
1283
|
// src/version.ts
|
|
1284
|
-
var VERSION = true ? "6.0.
|
|
1284
|
+
var VERSION = true ? "6.0.207" : "0.0.0-test";
|
|
1285
1285
|
|
|
1286
1286
|
// src/util/download/download.ts
|
|
1287
1287
|
var download = async ({
|
|
@@ -1303,6 +1303,7 @@ var download = async ({
|
|
|
1303
1303
|
abortSignal
|
|
1304
1304
|
});
|
|
1305
1305
|
if (!response.ok) {
|
|
1306
|
+
await (0, import_provider_utils3.cancelResponseBody)(response);
|
|
1306
1307
|
throw new import_provider_utils3.DownloadError({
|
|
1307
1308
|
url: urlText,
|
|
1308
1309
|
statusCode: response.status,
|