Set the correct content-type on negotiated XML-RPC requests. It was being set as text/plain when it should be text/xml.

rob
>From edf8e41cfe1f5142ced53376f509f2e0d4439cfe Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Thu, 11 Jul 2013 16:46:34 -0400
Subject: [PATCH] Return the correct Content-type on negotiated XML-RPC
 requests.

https://fedorahosted.org/freeipa/ticket/3745
---
 ipaserver/rpcserver.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 203825ea0c6c023184c6dbd079a5f451808f91e4..eb9b0734ac4956cb0e65664ae1cb4004d72020de 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -699,6 +699,7 @@ class xmlserver(WSGIExecutioner, HTTP_Status, KerberosSession):
 
         self.debug('WSGI xmlserver.__call__:')
         user_ccache=environ.get('KRB5CCNAME')
+        headers = [('Content-Type', 'text/xml; charset=utf-8')]
         if user_ccache is None:
             self.internal_error(environ, start_response,
                                 'xmlserver.__call__: KRB5CCNAME not defined in HTTP request environment')
@@ -708,11 +709,10 @@ class xmlserver(WSGIExecutioner, HTTP_Status, KerberosSession):
             response = super(xmlserver, self).__call__(environ, start_response)
             if getattr(context, 'session_data', None) is None and \
               self.env.context != 'lite':
-                self.finalize_kerberos_acquisition('xmlserver', user_ccache, environ, start_response)
+                self.finalize_kerberos_acquisition('xmlserver', user_ccache, environ, start_response, headers)
         except PublicError, e:
             status = HTTP_STATUS_SUCCESS
             response = status
-            headers = [('Content-Type', 'text/plain; charset=utf-8')]
             start_response(status, headers)
             return self.marshal(None, e)
         finally:
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to