mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-07 19:38:00 +02:00
Anthropic with stream=False complains about content-length not matching with the response size.
This commit is contained in:
@@ -140,11 +140,13 @@ async def handle_non_streaming_response(
|
||||
# Don't block on the response from explorer
|
||||
if context.dataset_name:
|
||||
asyncio.create_task(push_to_explorer(context, json_response))
|
||||
updated_headers = response.headers.copy()
|
||||
updated_headers.pop("Content-Length", None)
|
||||
return Response(
|
||||
content=json.dumps(json_response),
|
||||
status_code=response.status_code,
|
||||
media_type="application/json",
|
||||
headers=dict(response.headers),
|
||||
headers=dict(updated_headers),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user