Skip to content

Commit

Permalink
Only add headers if the message is a dict
Browse files Browse the repository at this point in the history
This is a short-term fix for #462. We don't know what type of object is
being passed as a message.

See #465 for follow-up to
this.

This is a cherry-pick of #462

Signed-off-by: Jeremy Cline <[email protected]>
  • Loading branch information
relrod authored and jeremycline committed Aug 9, 2017
1 parent 8290f0b commit e1a1c00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fedmsg/consumers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _consume(self, message):

# Pass along headers if present. May be useful to filters or
# fedmsg.meta routines.
if 'headers' in message and 'body' in message:
if isinstance(message, dict) and 'headers' in message and 'body' in message:
message['body']['headers'] = message['headers']

if hasattr(self, "replay_name"):
Expand Down

0 comments on commit e1a1c00

Please sign in to comment.