Skip to content

Commit 6307794

Browse files
author
Roland Hedberg
committed
Added accept header.
1 parent 66d13d0 commit 6307794

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/saml2/mdstore.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,11 @@ def load(self):
565565
self.entity[key] = item
566566

567567

568+
SAML_METADATA_CONTENT_TYPE = 'application/samlmetadata+xml'
569+
570+
568571
class MetaDataMDX(MetaData):
572+
569573
def __init__(self, onts, attrc, url, security, cert, http, **kwargs):
570574
"""
571575
:params onts:
@@ -589,7 +593,8 @@ def __getitem__(self, item):
589593
return self.entity[item]
590594
except KeyError:
591595
mdx_url = "%s/entities/%s" % (self.url, quote_plus(item))
592-
response = self.http.send(mdx_url)
596+
response = self.http.send(
597+
mdx_url, headers={'Accept': SAML_METADATA_CONTENT_TYPE})
593598
if response.status_code == 200:
594599
node_name = self.node_name \
595600
or "%s:%s" % (md.EntitiesDescriptor.c_namespace,

0 commit comments

Comments
 (0)