Skip to content

Commit

Permalink
Fix malformed string in rest activity.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcastill authored and Frank Martinez committed Jan 19, 2019
1 parent d962609 commit bf40dfd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions activity/rest/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ func (a *RESTActivity) Eval(context activity.Context) (done bool, err error) {

var result interface{}

if strings.Contains(resp.Header.Get(Content-Type), application/json) {
d := json.NewDecoder(bytes.NewReader(respBody))
d.UseNumber()
err = d.Decode(&result)
} else {
result = string(respBody)
}
if strings.Contains(resp.Header.Get("Content-Type"), "application/json") {
d := json.NewDecoder(bytes.NewReader(respBody))
d.UseNumber()
err = d.Decode(&result)
} else {
result = string(respBody)
}

//json.Unmarshal(respBody, &result)

Expand Down

0 comments on commit bf40dfd

Please sign in to comment.