@ai-sdk/provider-utils 5.0.44 → 5.0.45
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 +8 -0
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/detect-media-type.ts +40 -2
- package/src/fetch-with-validated-redirects.ts +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.45
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2973485: fix(provider-utils): detect AVIF and HEIC images with variable ftyp box sizes
|
|
8
|
+
- a4db5ea: fix(provider-utils): detect AAC audio with ADTS headers
|
|
9
|
+
- 2937ea2: fix(provider-utils): follow validated redirects without waiting for response clone cancellation
|
|
10
|
+
|
|
3
11
|
## 5.0.44
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -518,7 +518,7 @@ function handleFetchError({
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
// src/version.ts
|
|
521
|
-
var VERSION = true ? "5.0.
|
|
521
|
+
var VERSION = true ? "5.0.45" : "0.0.0-test";
|
|
522
522
|
|
|
523
523
|
// src/normalize-headers.ts
|
|
524
524
|
function normalizeHeaders(headers) {
|
|
@@ -684,7 +684,8 @@ var imageMediaTypeSignatures = [
|
|
|
684
684
|
0,
|
|
685
685
|
0,
|
|
686
686
|
0,
|
|
687
|
-
|
|
687
|
+
null,
|
|
688
|
+
// box size (variable)
|
|
688
689
|
102,
|
|
689
690
|
116,
|
|
690
691
|
121,
|
|
@@ -701,7 +702,8 @@ var imageMediaTypeSignatures = [
|
|
|
701
702
|
0,
|
|
702
703
|
0,
|
|
703
704
|
0,
|
|
704
|
-
|
|
705
|
+
null,
|
|
706
|
+
// box size (variable)
|
|
705
707
|
102,
|
|
706
708
|
116,
|
|
707
709
|
121,
|
|
@@ -721,6 +723,26 @@ var documentMediaTypeSignatures = [
|
|
|
721
723
|
}
|
|
722
724
|
];
|
|
723
725
|
var audioMediaTypeSignaturesWithoutMp4 = [
|
|
726
|
+
{
|
|
727
|
+
mediaType: "audio/aac",
|
|
728
|
+
bytesPrefix: [255, 240]
|
|
729
|
+
// MPEG-4 ADTS with CRC
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
mediaType: "audio/aac",
|
|
733
|
+
bytesPrefix: [255, 241]
|
|
734
|
+
// MPEG-4 ADTS without CRC
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
mediaType: "audio/aac",
|
|
738
|
+
bytesPrefix: [255, 248]
|
|
739
|
+
// MPEG-2 ADTS with CRC
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
mediaType: "audio/aac",
|
|
743
|
+
bytesPrefix: [255, 249]
|
|
744
|
+
// MPEG-2 ADTS without CRC
|
|
745
|
+
},
|
|
724
746
|
{
|
|
725
747
|
mediaType: "audio/mpeg",
|
|
726
748
|
bytesPrefix: [255, 251]
|
|
@@ -1318,7 +1340,7 @@ async function fetchWithValidatedRedirects({
|
|
|
1318
1340
|
}
|
|
1319
1341
|
const location = (_a3 = response.headers) == null ? void 0 : _a3.get("location");
|
|
1320
1342
|
if (REDIRECT_STATUS_CODES.has(response.status) && location) {
|
|
1321
|
-
|
|
1343
|
+
void cancelResponseBody(response);
|
|
1322
1344
|
const nextUrl = new URL(location, currentUrl).toString();
|
|
1323
1345
|
if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {
|
|
1324
1346
|
const userAgent = currentHeaders.get("user-agent");
|