Commits

benoitc  committed 0d0099f

better response for xrds recovery

  • Participants
  • Parent commits e47954f

Comments (0)

Files changed (1)

File django_authopenid/middleware.py

 from django.core.urlresolvers import reverse
 
 from django_authopenid.models import UserAssociation
+from django_authopenid.views import xrdf
 
 __all__ = ["OpenIDMiddleware"]
 
         if path == "/" and request.META.has_key('HTTP_ACCEPT') and \
                 best_match(['text/html', 'application/xrds+xml'], 
                     request.META['HTTP_ACCEPT']) == 'application/xrds+xml':
-            return HttpResponseRedirect(reverse('oid_xrdf'))
+            response = xrdf(request)
+            response['Content-Type'] = "application/xrds+xml"
         return response