forked from GithubBackups/healthchecks
/bounce handles long payloads.
This commit is contained in:
parent
68d591c677
commit
d5cb669172
@ -34,3 +34,9 @@ class BounceTestCase(BaseTestCase):
|
||||
url = "/api/v1/notifications/%s/bounce" % self.n.code
|
||||
r = self.client.post(url, "foo", content_type="text/plain")
|
||||
self.assertEqual(r.status_code, 400)
|
||||
|
||||
def test_it_handles_long_payload(self):
|
||||
url = "/api/v1/notifications/%s/bounce" % self.n.code
|
||||
payload = "A" * 500
|
||||
r = self.client.post(url, payload, content_type="text/plain")
|
||||
self.assertEqual(r.status_code, 200)
|
||||
|
@ -190,7 +190,7 @@ def bounce(request, code):
|
||||
if td.total_seconds() > 600:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
notification.error = request.body
|
||||
notification.error = request.body[:200]
|
||||
notification.save()
|
||||
|
||||
return HttpResponse()
|
||||
|
Loading…
x
Reference in New Issue
Block a user