SecurityHeadersMiddleware subclassed Starlette BaseHTTPMiddleware, which wraps streaming responses in its own anyio task group. On the /v1/chat/completions SSE stream this broke request.is_disconnected(), so GGUF generation was never aborted on a client disconnect (the GPU stayed pinned at 100% and the UI hung on "Generating"), and it raised "Attempted to exit a cancel scope that isn't the current task's current cancel scope" mid-stream. Convert it to a pure ASGI middleware that edits headers on http.response.start and forwards the receive channel untouched, matching LoggingMiddleware. Response headers are unchanged. Adds regression tests. |
||
|---|---|---|
| .. | ||
| backend | ||
| frontend | ||
| src-tauri | ||
| __init__.py | ||
| install_llama_prebuilt.py | ||
| install_python_stack.py | ||
| LICENSE.AGPL-3.0 | ||
| package-lock.json | ||
| package.json | ||
| setup.bat | ||
| setup.ps1 | ||
| setup.sh | ||
| Unsloth_Studio_Colab.ipynb | ||