@dahawa/hawa-cli-analysis 2.2.0 → 2.2.2
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/claude/claude-proxy.js +8 -6
- package/package.json +1 -1
package/claude/claude-proxy.js
CHANGED
|
@@ -122,11 +122,13 @@ function logAPI(fullLog){
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
function headersToObject(headers) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
if (!headers) return {};
|
|
126
|
+
|
|
127
|
+
if (typeof headers.entries === "function") {
|
|
128
|
+
return Object.fromEntries(headers.entries());
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return { ...headers };
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
const fastify = Fastify(
|
|
@@ -213,7 +215,7 @@ async function handel(request, reply, endpoint){
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
//如果对 tools 修改了这里的长度肯定要变化的
|
|
216
|
-
let requestHeaders = {...request.headers}
|
|
218
|
+
let requestHeaders = {...request.headers,"accept-encoding":"identity"}
|
|
217
219
|
delete requestHeaders["content-length"]; //可能还有大小写问题
|
|
218
220
|
//console.log(requestHeaders);
|
|
219
221
|
|