Skip to content

Commit 803ec03

Browse files
committed
fix: replace audio mpeg type check with broader audio check
1 parent c4e10a9 commit 803ec03

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/globals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ export const CONTENT_TYPES = {
4444
MULTIPART_FORM_DATA: "multipart/form-data",
4545
EVENT_STREAM: "text/event-stream",
4646
AUDIO_MPEG: "audio/mpeg",
47-
APPLICATION_OCTET_STREAM: "application/octet-stream"
47+
APPLICATION_OCTET_STREAM: "application/octet-stream",
48+
GENERIC_AUDIO_PATTERN: "audio"
4849
}

src/handlers/handlerUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ export function responseHandler(response: Response, streamingMode: boolean, prox
519519
return handleJSONToStreamResponse(response, proxyProvider, responseTransformerFunction)
520520
} else if (streamingMode && response.status === 200) {
521521
return handleStreamingMode(response, proxyProvider, responseTransformerFunction, requestURL)
522-
} else if (responseContentType === CONTENT_TYPES.AUDIO_MPEG) {
522+
} else if (responseContentType?.startsWith(CONTENT_TYPES.GENERIC_AUDIO_PATTERN)) {
523523
return handleAudioResponse(response)
524524
} else if (responseContentType === CONTENT_TYPES.APPLICATION_OCTET_STREAM) {
525525
return handleOctetStreamResponse(response)

0 commit comments

Comments
 (0)