diff --git a/djrill/tests/test_mandrill_webhook.py b/djrill/tests/test_mandrill_webhook.py index 1b3943c..d2969e4 100644 --- a/djrill/tests/test_mandrill_webhook.py +++ b/djrill/tests/test_mandrill_webhook.py @@ -67,7 +67,7 @@ class DjrillWebhookSignatureMixinTests(TestCase): def test_signature(self): signature = hmac.new(key=b(settings.DJRILL_WEBHOOK_SIGNATURE_KEY), msg = b(settings.DJRILL_WEBHOOK_URL+"mandrill_events[]"), digestmod=hashlib.sha1) hash_string = b64encode(signature.digest()) - response = self.client.post('/webhook/?secret=abc123', data={"mandrill_events":"[]"}, **{"X-Mandrill-Signature" : hash_string}) + response = self.client.post('/webhook/?secret=abc123', data={"mandrill_events":"[]"}, **{"HTTP_X_MANDRILL_SIGNATURE" : hash_string}) self.assertEqual(response.status_code, 200) def tearDown(self): diff --git a/djrill/views.py b/djrill/views.py index 04f132d..eb60320 100644 --- a/djrill/views.py +++ b/djrill/views.py @@ -118,7 +118,7 @@ class DjrillWebhookSignatureMixin(object): raise ImproperlyConfigured( "You have set DJRILL_WEBHOOK_SIGNATURE_KEY, but haven't set DJRILL_WEBHOOK_URL in the settings file.") - signature = request.META.get("X-Mandrill-Signature", None) + signature = request.META.get("HTTP_X_MANDRILL_SIGNATURE", None) if not signature: return HttpResponse(status=403, content="X-Mandrill-Signature not set")