Skip to content

Commit

Permalink
fix: improve regex expression for json and xml content type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Sep 23, 2023
1 parent 7c1134f commit 683c9c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Expand Up @@ -62,8 +62,8 @@ var (
jsonContentType = "application/json"
formContentType = "application/x-www-form-urlencoded"

jsonCheck = regexp.MustCompile(`(?i:(application|text)/(json|.*\+json|json\-.*)(;|$))`)
xmlCheck = regexp.MustCompile(`(?i:(application|text)/(xml|.*\+xml)(;|$))`)
jsonCheck = regexp.MustCompile(`(?i:(application|text)/(.*json.*)(;|$))`)
xmlCheck = regexp.MustCompile(`(?i:(application|text)/(.*xml.*)(;|$))`)

hdrUserAgentValue = "go-resty/" + Version + " (https://github.com/go-resty/resty)"
bufPool = &sync.Pool{New: func() interface{} { return &bytes.Buffer{} }}
Expand Down

0 comments on commit 683c9c1

Please sign in to comment.