Skip to content

Commit

Permalink
ADD non-unquote checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
karminski committed Jan 4, 2024
1 parent 233c9dd commit df6fc77
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/actionruntime/restapi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ func (r *RawBody) UnmarshalRawBody() (interface{}, string) {
if err := json.Unmarshal([]byte(rawStr), &listData); err == nil {
return listData, "application/json"
}
// try non-unquote
if err := json.Unmarshal([]byte(r.Content), &data); err == nil {
return data, "application/json"
}
if err := json.Unmarshal([]byte(r.Content), &listData); err == nil {
return listData, "application/json"
}
return rawStr, "application/json"
case "xml":
rawStr, err := strconv.Unquote(r.Content)
Expand Down

0 comments on commit df6fc77

Please sign in to comment.