From: Alex Kamedov Date: Sun, 24 Apr 2011 14:20:26 +0000 (+0600) Subject: replace \r\n in CAS v.1 validate response to \n X-Git-Tag: 22.4~32^2~20^2~1 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/9cd57bfa9544aa6793e6cf5a678590b4cad83986?hp=--cc replace \r\n in CAS v.1 validate response to \n --- 9cd57bfa9544aa6793e6cf5a678590b4cad83986 diff --git a/cas_provider/tests.py b/cas_provider/tests.py index 5129d66..4d44242 100644 --- a/cas_provider/tests.py +++ b/cas_provider/tests.py @@ -96,14 +96,14 @@ class ViewsTest(TestCase): response = self.client.get(reverse('cas_validate'), {'ticket': ticket, 'service': self.service}, follow=False) self.assertEqual(response.status_code, 200) - self.assertEqual(unicode(response.content), u'yes\r\n%s\r\n' % self.username) + self.assertEqual(unicode(response.content), u'yes\n%s\n' % self.username) else: self.assertEqual(response.status_code, 200) self.assertEqual(len(response.context['form'].errors), 1) response = self.client.get(reverse('cas_validate'), {'ticket': 'ST-12312312312312312312312', 'service': self.service}, follow=False) self.assertEqual(response.status_code, 200) - self.assertEqual(response.content, u'no\r\n\r\n') + self.assertEqual(response.content, u'no\n\n') def _validate_cas2(self, response, is_correct=True): diff --git a/cas_provider/views.py b/cas_provider/views.py index 8a6e4bf..b2e54f2 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -67,10 +67,10 @@ def validate(request): ticket = ServiceTicket.objects.get(ticket=ticket_string) username = ticket.user.username ticket.delete() - return HttpResponse("yes\r\n%s\r\n" % username) + return HttpResponse("yes\n%s\n" % username) except: pass - return HttpResponse("no\r\n\r\n") + return HttpResponse("no\n\n") def logout(request, template_name='cas/logout.html'):