diff --git a/moto/sns/models.py b/moto/sns/models.py index db6760604..ebdf5cd16 100644 --- a/moto/sns/models.py +++ b/moto/sns/models.py @@ -101,7 +101,7 @@ class Subscription(BaseModel): 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) - requests.post(self.endpoint, json=post_data) + requests.post(self.endpoint, json=post_data, headers={'Content-Type': 'text/plain; charset=UTF-8'}) elif self.protocol == 'lambda': # TODO: support bad function name # http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html diff --git a/tests/test_sns/test_publishing_boto3.py b/tests/test_sns/test_publishing_boto3.py index 7fc9374e1..65d2f25cc 100644 --- a/tests/test_sns/test_publishing_boto3.py +++ b/tests/test_sns/test_publishing_boto3.py @@ -253,7 +253,7 @@ def test_publish_to_sqs_in_different_region(): @mock_sns def test_publish_to_http(): def callback(request): - request.headers["Content-Type"].should.equal("application/json") + request.headers["Content-Type"].should.equal("text/plain; charset=UTF-8") json.loads.when.called_with( request.body.decode() ).should_not.throw(Exception)