Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit a626d93

Browse files
authored
fix(tpl): wrong json/xml reg check (#234)
1 parent ba38d82 commit a626d93

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tpl/hertz/client/standard/package.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ layouts:
135135
jsonContentType = "application/json; charset=utf-8"
136136
formContentType = "multipart/form-data"
137137
138-
jsonCheck = regexp.MustCompile(`(?i:(application|text)/(json|.*\+json|json\-.*)(; |$))`)
139-
xmlCheck = regexp.MustCompile(`(?i:(application|text)/(xml|.*\+xml)(; |$))`)
140-
138+
jsonCheck = regexp.MustCompile(`(?i)^(application|text)/(json|.*\+json|json-[a-z]+)(;\s*|$)`)
139+
xmlCheck = regexp.MustCompile(`(?i)^(application|text)/(xml|.*\+xml$)(;\s*|$)`)
141140
)
142141
143142
// Configuration of client

0 commit comments

Comments
 (0)