diff --git a/CHANGELOG.md b/CHANGELOG.md index df3f31db..9fee2af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - +## [0.1.3] - 2019-02-27 +### Changed +- Fix for [issue 126](https://github.com/Comcast/caduceus/issues/126) + ## [0.1.2] - 2019-02-21 ### Added - Fix for delivering events as json or msgpack based events [issue 113](https://github.com/Comcast/caduceus/issues/113) @@ -38,7 +42,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Initial creation -[Unreleased]: https://github.com/Comcast/caduceus/compare/0.1.2...HEAD +[Unreleased]: https://github.com/Comcast/caduceus/compare/0.1.3...HEAD +[0.1.3]: https://github.com/Comcast/caduceus/compare/0.1.2...0.1.3 [0.1.2]: https://github.com/Comcast/caduceus/compare/0.1.1...0.1.2 [0.1.1]: https://github.com/Comcast/caduceus/compare/0.0.1...0.1.1 [0.0.1]: https://github.com/Comcast/caduceus/compare/0.0.0...0.0.1 diff --git a/src/caduceus/outboundSender.go b/src/caduceus/outboundSender.go index 3e0b6ded..c25f2ba3 100644 --- a/src/caduceus/outboundSender.go +++ b/src/caduceus/outboundSender.go @@ -461,6 +461,7 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess defer obs.workers.Release() payload := msg.Payload + body := payload var payloadReader *bytes.Reader // Use the internal content type unless the accept type is wrp @@ -473,10 +474,9 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess buffer := bytes.NewBuffer([]byte{}) encoder := wrp.NewEncoder(buffer, wrp.Msgpack) encoder.Encode(msg) - payloadReader = bytes.NewReader(buffer.Bytes()) - default: - payloadReader = bytes.NewReader(payload) + body = buffer.Bytes() } + payloadReader = bytes.NewReader(body) req, err := http.NewRequest("POST", obs.id, payloadReader) if nil != err { @@ -505,7 +505,7 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess if "" != secret { s := hmac.New(sha1.New, []byte(secret)) - s.Write(payload) + s.Write(body) sig := fmt.Sprintf("sha1=%s", hex.EncodeToString(s.Sum(nil))) req.Header.Set("X-Webpa-Signature", sig) }