From 8a33f3ef697b4b377c9172d1b8421ad152fc0c77 Mon Sep 17 00:00:00 2001 From: hkfires <10558748+hkfires@users.noreply.github.com> Date: Wed, 19 Nov 2025 14:43:32 +0800 Subject: [PATCH] fix: detect HTML error bodies without text/html content type --- internal/runtime/executor/logging_helpers.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/runtime/executor/logging_helpers.go b/internal/runtime/executor/logging_helpers.go index 4e86f3a8..26931f53 100644 --- a/internal/runtime/executor/logging_helpers.go +++ b/internal/runtime/executor/logging_helpers.go @@ -323,7 +323,14 @@ func formatAuthInfo(info upstreamRequestLog) string { } func summarizeErrorBody(contentType string, body []byte) string { - if strings.Contains(strings.ToLower(contentType), "text/html") { + isHTML := strings.Contains(strings.ToLower(contentType), "text/html") + if !isHTML { + trimmed := bytes.TrimSpace(bytes.ToLower(body)) + if bytes.HasPrefix(trimmed, []byte("