fix: normalize content-type header case in whisper transcription fallback

This commit is contained in:
Cursor Agent 2026-06-17 03:05:19 +00:00
parent e3d6384e5e
commit 72982e4342
No known key found for this signature in database

View file

@ -133,7 +133,7 @@ class OpenAIWhisperAudioTranscriptionConfig(BaseAudioTranscriptionConfig):
try:
raw_response_json = raw_response.json()
except json.JSONDecodeError:
content_type = raw_response.headers.get("content-type", "")
content_type = raw_response.headers.get("content-type", "").lower()
if "application/json" in content_type:
raise
return TranscriptionResponse(text=raw_response.text)