refactor: optimize axios interceptor text/html content type detection (#7142)

#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

#### What this PR does / why we need it:

Optimize axios interceptor text/html content type detection

<img width="1461" alt="image" src="https://github.com/user-attachments/assets/6bb59a1d-81cc-4ea2-ac61-17e30eab4281" />

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/7149/head
Ryan Wang 2024-12-16 23:28:10 +08:00 committed by GitHub
parent f9ddeebb1f
commit 8f39266c8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ export function setupApiClient() {
const contentType = error.response?.headers["content-type"];
if (contentType === "text/html") {
if (contentType.toLowerCase().includes("text/html")) {
createHTMLContentModal({
uniqueId: objectHash(error.response?.data || ""),
title: error.response?.status.toString(),