Skip to content

Commit

Permalink
refactor: optimize axios interceptor text/html content type detection (
Browse files Browse the repository at this point in the history
…#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
```
  • Loading branch information
ruibaby authored Dec 16, 2024
1 parent f9ddeeb commit 8f39266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/setup/setupApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 8f39266

Please sign in to comment.