@ai-sdk/provider-utils 4.0.20 → 4.0.22

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.
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/test/index.ts
21
- var test_exports = {};
22
- __export(test_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  convertArrayToAsyncIterable: () => convertArrayToAsyncIterable,
24
24
  convertArrayToReadableStream: () => convertArrayToReadableStream,
25
25
  convertAsyncIterableToArray: () => convertAsyncIterableToArray,
@@ -28,7 +28,7 @@ __export(test_exports, {
28
28
  isNodeVersion: () => isNodeVersion,
29
29
  mockId: () => mockId
30
30
  });
31
- module.exports = __toCommonJS(test_exports);
31
+ module.exports = __toCommonJS(index_exports);
32
32
 
33
33
  // src/test/convert-array-to-async-iterable.ts
34
34
  function convertArrayToAsyncIterable(values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "4.0.20",
3
+ "version": "4.0.22",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -69,9 +69,7 @@
69
69
  "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
70
70
  "build:watch": "pnpm clean && tsup --watch",
71
71
  "clean": "del-cli dist *.tsbuildinfo",
72
- "lint": "eslint \"./**/*.ts*\"",
73
72
  "type-check": "tsc --build",
74
- "prettier-check": "prettier --check \"./**/*.ts*\"",
75
73
  "test": "pnpm test:node && pnpm test:edge",
76
74
  "test:update": "pnpm test:node -u",
77
75
  "test:watch": "vitest --config vitest.node.config.js",
@@ -18,11 +18,16 @@ export function validateDownloadUrl(url: string): void {
18
18
  });
19
19
  }
20
20
 
21
- // Only allow http and https protocols
21
+ // data: URLs are inline content, so they do not trigger a network fetch or SSRF risk.
22
+ if (parsed.protocol === 'data:') {
23
+ return;
24
+ }
25
+
26
+ // Only allow http and https network protocols
22
27
  if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
23
28
  throw new DownloadError({
24
29
  url,
25
- message: `URL scheme must be http or https, got ${parsed.protocol}`,
30
+ message: `URL scheme must be http, https, or data, got ${parsed.protocol}`,
26
31
  });
27
32
  }
28
33