From 395bffa681635074564999f2f5c2d6f1ba8ea8c7 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 9 Aug 2017 15:51:42 -0400 Subject: [PATCH] Only add headers if the message is a dict This is a short-term fix for #462. We don't know what type of object is being passed as a message. See https://github.com/fedora-infra/fedmsg/issues/465 for follow-up to this. Signed-off-by: Jeremy Cline --- fedmsg/consumers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedmsg/consumers/__init__.py b/fedmsg/consumers/__init__.py index ba86d75d..2efe457b 100644 --- a/fedmsg/consumers/__init__.py +++ b/fedmsg/consumers/__init__.py @@ -286,7 +286,7 @@ def _consume(self, message): # Pass along headers if present. May be useful to filters or # fedmsg.meta routines. - if 'headers' in message.__dict__ and 'body' in message.__dict__: + if isinstance(message, dict) and 'headers' in message and 'body' in message: message['body']['headers'] = message['headers'] if hasattr(self, "replay_name"):