pngwn HF staff commited on
Commit
8ee459f
1 Parent(s): d0d3b45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -139,7 +139,15 @@ async def proxy_to_node(
139
 
140
  print(f"\nHeaders: {r.headers}\n")
141
 
142
- return StreamingResponse(r.aiter_raw(), headers=r.headers)
 
 
 
 
 
 
 
 
143
 
144
 
145
  @app.api_route(
 
139
 
140
  print(f"\nHeaders: {r.headers}\n")
141
 
142
+ new_headers = {
143
+ key: value
144
+ for key, value in response.headers.items()
145
+ if key.lower() != "content-length"
146
+ }
147
+
148
+ new_headers["Transfer-Encoding"] = "chunked"
149
+
150
+ return StreamingResponse(response.aiter_raw(), headers=new_headers)
151
 
152
 
153
  @app.api_route(