We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98f7c23 commit c9b1bc6Copy full SHA for c9b1bc6
crates/services/src/response/service.rs
@@ -54,6 +54,14 @@ impl OpenAIProxyService for OpenAIProxy {
54
headers.remove("authorization");
55
headers.remove("host"); // Don't forward host header
56
57
+ // If no body is provided, remove content-related headers to avoid
58
+ // the server waiting for body data that will never arrive
59
+ if body.is_none() {
60
+ headers.remove("content-length");
61
+ headers.remove("content-type");
62
+ headers.remove("transfer-encoding");
63
+ }
64
+
65
tracing::debug!("Forwarding {} header(s) to OpenAI", headers.len());
66
for (key, value) in headers.iter() {
67
request_builder = request_builder.header(key, value);
0 commit comments