dont panic on missing headers in broker event (#963)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
94d409b180
commit
da6c1be607
@ -169,6 +169,11 @@ func (s *rpcServer) createSubHandler(sb *subscriber, opts Options) broker.Handle
|
|||||||
return func(p broker.Event) error {
|
return func(p broker.Event) error {
|
||||||
msg := p.Message()
|
msg := p.Message()
|
||||||
|
|
||||||
|
if msg.Header == nil {
|
||||||
|
// create empty map in case of headers empty to avoid panic later
|
||||||
|
msg.Header = make(map[string]string)
|
||||||
|
}
|
||||||
|
|
||||||
// get codec
|
// get codec
|
||||||
ct := msg.Header["Content-Type"]
|
ct := msg.Header["Content-Type"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user