Merge pull request #1654 from Birne94/sns-raw-message-delivery

Add RawMessageDelivery for SNS subscriptions (fixes #1571)
This commit is contained in:
Steve Pulec 2018-05-30 09:46:59 -04:00 committed by GitHub
commit b6909ff64c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View file

@ -94,7 +94,10 @@ class Subscription(BaseModel):
if self.protocol == 'sqs':
queue_name = self.endpoint.split(":")[-1]
region = self.endpoint.split(":")[3]
enveloped_message = json.dumps(self.get_post_data(message, message_id, subject, message_attributes=message_attributes), sort_keys=True, indent=2, separators=(',', ': '))
if self.attributes.get('RawMessageDelivery') != 'true':
enveloped_message = json.dumps(self.get_post_data(message, message_id, subject, message_attributes=message_attributes), sort_keys=True, indent=2, separators=(',', ': '))
else:
enveloped_message = message
sqs_backends[region].send_message(queue_name, enveloped_message)
elif self.protocol in ['http', 'https']:
post_data = self.get_post_data(message, message_id, subject)