UI proxy: keep Content-Encoding so compressed Next.js responses render in browsers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 changed file +2 −1
modified
server/llm_api/proxy_ui.py
+2 −1
@@ -8,8 +8,9 @@ from fastapi.responses import HTMLResponse, StreamingResponse | ||
| 8 | 8 | |
| 9 | 9 | router = APIRouter() |
| 10 | 10 | |
| 11 | +# content-encoding is deliberately kept: the body is forwarded as-is (compressed) so the header must stay with it. | |
| 11 | 12 | HOP_BY_HOP = {"connection", "keep-alive", "proxy-authenticate", "proxy-authorization", "te", "trailers", |
| 12 | − "transfer-encoding", "upgrade", "content-length", "content-encoding"} | |
| 13 | + "transfer-encoding", "upgrade", "content-length"} | |
| 13 | 14 | |
| 14 | 15 | FALLBACK_HTML = """<!doctype html><html><head><meta charset="utf-8"><title>LLM API</title> |
| 15 | 16 | <style>body{font-family:-apple-system,system-ui,sans-serif;background:#0b0d10;color:#e6e8eb;display:grid;place-items:center;height:100vh;margin:0} |
| 16 | 17 | |