@ai-sdk/provider-utils 4.0.64 → 4.0.65
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 +6 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/fetch-with-validated-redirects.ts +13 -0
package/dist/index.mjs
CHANGED
|
@@ -631,6 +631,12 @@ async function fetchWithValidatedRedirects({
|
|
|
631
631
|
if (REDIRECT_STATUS_CODES.has(response.status) && location) {
|
|
632
632
|
void cancelResponseBody(response);
|
|
633
633
|
const nextUrl = new URL(location, currentUrl).toString();
|
|
634
|
+
if (new URL(currentUrl).protocol === "https:" && new URL(nextUrl).protocol === "http:") {
|
|
635
|
+
throw new DownloadError({
|
|
636
|
+
url,
|
|
637
|
+
message: "Redirect from HTTPS to HTTP was blocked"
|
|
638
|
+
});
|
|
639
|
+
}
|
|
634
640
|
if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {
|
|
635
641
|
const userAgent = currentHeaders.get("user-agent");
|
|
636
642
|
currentHeaders = new Headers(
|
|
@@ -933,7 +939,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
933
939
|
}
|
|
934
940
|
|
|
935
941
|
// src/version.ts
|
|
936
|
-
var VERSION = true ? "4.0.
|
|
942
|
+
var VERSION = true ? "4.0.65" : "0.0.0-test";
|
|
937
943
|
|
|
938
944
|
// src/get-from-api.ts
|
|
939
945
|
var getOriginalFetch = () => globalThis.fetch;
|