diff --git a/.gitignore b/.gitignore index 359006b7..51b3e357 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ wallet.sqlite3 # Development .notes -.keys.db -.wallet.sqlite3 -.models.json +.*keys.db +.*wallet.sqlite3 +.*models.json compose.override.yml diff --git a/router/proxy.py b/router/proxy.py index 91f0c0c2..6552bfb3 100644 --- a/router/proxy.py +++ b/router/proxy.py @@ -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: