Commits

Anonymous committed 80d8d08

alway send with right content-type

Comments (0)

Files changed (2)

django_authopenid/middleware.py

                 best_match(['text/html', 'application/xrds+xml'], 
                     request.META['HTTP_ACCEPT']) == 'application/xrds+xml':
             response = xrdf(request)
-            response['Content-Type'] = "application/xrds+xml"
-            response['X-XRDS-Location']= request.build_absolute_uri(reverse('oid_xrdf'))
         return response

django_authopenid/views.py

     return_to = [
         "%s%s" % (url_host, reverse('user_complete_signin'))
     ]
-    return render(template_name, { 
+    response = render(template_name, { 
         'return_to': return_to 
         }, context_instance=RequestContext(request))
         
         
+    response['Content-Type'] = "application/xrds+xml"
+    response['X-XRDS-Location']= request.build_absolute_uri(reverse('oid_xrdf'))
+    return response    
+        
 @login_required
 def password_change(request, 
         template_name='authopenid/password_change_form.html',