@ai-sdk/amazon-bedrock 4.0.192 → 4.0.194

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/dist/index.mjs CHANGED
@@ -2382,7 +2382,7 @@ import {
2382
2382
  import { AwsV4Signer } from "aws4fetch";
2383
2383
 
2384
2384
  // src/version.ts
2385
- var VERSION = true ? "4.0.192" : "0.0.0-test";
2385
+ var VERSION = true ? "4.0.194" : "0.0.0-test";
2386
2386
 
2387
2387
  // src/bedrock-sigv4-fetch.ts
2388
2388
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
@@ -2419,7 +2419,9 @@ function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
2419
2419
  const signer = new AwsV4Signer({
2420
2420
  url,
2421
2421
  method: "POST",
2422
- headers: Object.entries(headersWithUserAgent),
2422
+ headers: Object.entries(headersWithUserAgent).filter(
2423
+ ([, value]) => isAscii(value)
2424
+ ),
2423
2425
  body,
2424
2426
  region: credentials.region,
2425
2427
  accessKeyId: credentials.accessKeyId,
@@ -2448,6 +2450,9 @@ function prepareBodyString(body) {
2448
2450
  return JSON.stringify(body);
2449
2451
  }
2450
2452
  }
2453
+ function isAscii(value) {
2454
+ return !/[\u0080-\uffff]/.test(value);
2455
+ }
2451
2456
  function createApiKeyFetchFunction(apiKey, fetch) {
2452
2457
  return async (input, init) => {
2453
2458
  const effectiveFetch = fetch != null ? fetch : globalThis.fetch;