Skip to content

Commit

Permalink
Merge pull request #1 from cv65kr/fix-decode-message
Browse files Browse the repository at this point in the history
Fix message decoding
  • Loading branch information
kukushkin authored Dec 16, 2020
2 parents 6ecd9bf + 74f2ca3 commit 8cb516e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/gosns/gosns.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,12 @@ func publishSQS(w http.ResponseWriter, req *http.Request,
} else {
msg.MessageAttributes = messageAttributes
msg.MD5OfMessageAttributes = common.HashAttributes(messageAttributes)
msg.MessageBody = []byte(messageBody)
m, err := extractMessageFromJSON(messageBody, subs.Protocol)
if (err == nil) {
msg.MessageBody = []byte(m)
} else {
msg.MessageBody = []byte(messageBody)
}
}

msg.MD5OfMessageBody = common.GetMD5Hash(messageBody)
Expand Down

0 comments on commit 8cb516e

Please sign in to comment.