From a19a69de470d6bd62e60123c688b8f41ed439921 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Wed, 26 Mar 2025 13:58:45 +0800 Subject: [PATCH] fix(tpl): wrong json/xml reg check --- tpl/hertz/client/standard/package.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tpl/hertz/client/standard/package.yaml b/tpl/hertz/client/standard/package.yaml index 7157c7c7..2413ab4b 100644 --- a/tpl/hertz/client/standard/package.yaml +++ b/tpl/hertz/client/standard/package.yaml @@ -135,9 +135,8 @@ layouts: jsonContentType = "application/json; charset=utf-8" formContentType = "multipart/form-data" - jsonCheck = regexp.MustCompile(`(?i:(application|text)/(json|.*\+json|json\-.*)(; |$))`) - xmlCheck = regexp.MustCompile(`(?i:(application|text)/(xml|.*\+xml)(; |$))`) - + jsonCheck = regexp.MustCompile(`(?i)^(application|text)/(json|.*\+json|json-[a-z]+)(;\s*|$)`) + xmlCheck = regexp.MustCompile(`(?i)^(application|text)/(xml|.*\+xml$)(;\s*|$)`) ) // Configuration of client