Skip to content

Commit cc18eae

Browse files
author
Paweł Kędzia
committed
**FIX** Remove default Accept: application/json header and explicitly set Accept: text/event-stream for SSE responses.
1 parent 211a6fa commit cc18eae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llm_router_api/endpoints/httprequest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def stream_response(
237237
method = (self._endpoint.method or "POST").upper()
238238
headers = {
239239
"Content-Type": "application/json",
240-
"Accept": "application/json",
241240
}
242241
token = api_model_provider.api_token
243242
if token:
@@ -486,7 +485,7 @@ def _stream_generic(
486485
receive the standard Server-Sent Events format.
487486
"""
488487
# Ensure we accept SSE format
489-
headers.setdefault("Accept", "text/event-stream")
488+
headers["Accept"] = "text/event-stream"
490489

491490
def _iter() -> Iterator[bytes]:
492491
try:

0 commit comments

Comments
 (0)