mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-12 12:13:21 +00:00
fixed non-streaming responses
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@ wallet.sqlite3
|
||||
|
||||
# Development
|
||||
.notes
|
||||
.keys.db
|
||||
.wallet.sqlite3
|
||||
.models.json
|
||||
.*keys.db
|
||||
.*wallet.sqlite3
|
||||
.*models.json
|
||||
compose.override.yml
|
||||
|
||||
+8
-1
@@ -189,10 +189,17 @@ async def proxy(
|
||||
key, response_json, session
|
||||
)
|
||||
response_json["cost"] = cost_data
|
||||
|
||||
response_headers = dict(response.headers)
|
||||
|
||||
# Remove Transfer-Encoding header to avoid conflict with Content-Length header in common nginx setups
|
||||
if "transfer-encoding" in response_headers:
|
||||
del response_headers["transfer-encoding"]
|
||||
|
||||
return Response(
|
||||
content=json.dumps(response_json).encode(),
|
||||
status_code=response.status_code,
|
||||
headers=dict(response.headers),
|
||||
headers=response_headers,
|
||||
media_type="application/json",
|
||||
)
|
||||
except json.JSONDecodeError as e:
|
||||
|
||||
Reference in New Issue
Block a user