mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-25 02:24:22 +00:00
Fix double read of json response when content-length header is missing
This commit is contained in:
@@ -26,7 +26,8 @@ export async function handleApiError(response: Response): Promise<void> {
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
const errorMessage = await parseErrorResponse(response)
|
||||
// Clone the response before reading to avoid consuming the body stream
|
||||
const errorMessage = await parseErrorResponse(response.clone())
|
||||
throw new Error(errorMessage)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user