Skip to content

Commit 51d3663

Browse files
committed
Fix: Handle text/plain response content type correctly
1 parent a6aaa98 commit 51d3663

File tree

1 file changed

+5
-1
lines changed
  • console/atest-ui/src/views

1 file changed

+5
-1
lines changed

console/atest-ui/src/views/net.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ async function DefaultResponseProcess(response: any) {
2525
const message = await response.json().then((data: any) => data.message)
2626
throw new Error(message)
2727
} else {
28-
return response.json()
28+
const contentType = response.headers.get('Content-Type') || '';
29+
if (contentType.includes('text/plain')) {
30+
return response.text();
31+
}
32+
return response.json();
2933
}
3034
}
3135

0 commit comments

Comments
 (0)