@opencompress/opencompress 1.9.0 → 1.9.1
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.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
|
-
var VERSION = "1.9.
|
|
9
|
+
var VERSION = "1.9.1";
|
|
10
10
|
var DEFAULT_BASE_URL = "https://www.opencompress.ai/api";
|
|
11
11
|
function getApiKey(api) {
|
|
12
12
|
const auth = api.config.auth;
|
|
@@ -222,10 +222,10 @@ function enableProxy(api, baseUrl) {
|
|
|
222
222
|
if (pApi === "anthropic-messages") {
|
|
223
223
|
provider.headers = {
|
|
224
224
|
...provider.headers || {},
|
|
225
|
-
"x-
|
|
225
|
+
"x-upstream-key": provider.apiKey || ""
|
|
226
226
|
};
|
|
227
227
|
provider.baseUrl = `${baseUrl}/v1`;
|
|
228
|
-
provider.apiKey =
|
|
228
|
+
provider.apiKey = occKey;
|
|
229
229
|
} else {
|
|
230
230
|
provider.headers = {
|
|
231
231
|
...provider.headers || {},
|
|
@@ -265,6 +265,7 @@ function disableProxy(api) {
|
|
|
265
265
|
delete h["X-Upstream-Key"];
|
|
266
266
|
delete h["X-Upstream-Base-Url"];
|
|
267
267
|
delete h["x-api-key"];
|
|
268
|
+
delete h["x-upstream-key"];
|
|
268
269
|
if (Object.keys(h).length === 0) delete provider.headers;
|
|
269
270
|
}
|
|
270
271
|
}
|