summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hörberg <haho0032@hashog.umdc.umu.se>2013-05-08 10:49:57 +0200
committerHans Hörberg <haho0032@hashog.umdc.umu.se>2013-05-08 10:49:57 +0200
commit5a30feee730791f2022b33f89ac11425af6b4c64 (patch)
tree9a18d257b3e0fb77f6d94ca13b1aa80e65f9b24a
parentd19530e42bad9490492c4c2de1ff2ae8de9cba44 (diff)
downloadpysaml2-5a30feee730791f2022b33f89ac11425af6b4c64.tar.gz
May not add content type if one exists in the header.
-rw-r--r--src/saml2/httputil.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/saml2/httputil.py b/src/saml2/httputil.py
index cf93f126..ba4baf37 100644
--- a/src/saml2/httputil.py
+++ b/src/saml2/httputil.py
@@ -39,7 +39,12 @@ class Response(object):
self.headers = kwargs.get('headers', [])
_content_type = kwargs.get('content', self._content_type)
- self.headers.append(('Content-type', _content_type))
+ addContentType = True
+ for header in self.headers:
+ if 'content-type' == header[0].lower():
+ addContentType = False
+ if addContentType:
+ self.headers.append(('Content-type', _content_type))
def __call__(self, environ, start_response, **kwargs):
start_response(self.status, self.headers)