0001-really-retrieve-XML-encoding-10196.patch
mellon/utils.py | ||
---|---|---|
255 | 255 | |
256 | 256 |
def get_xml_encoding(content): |
257 | 257 |
xml_encoding = 'utf-8' |
258 | ||
258 | 259 |
def xmlDeclHandler(version, encoding, standalone): |
259 |
xml_encoding = encoding |
|
260 |
global xml_encoding |
|
261 | ||
262 |
if encoding: |
|
263 |
xml_encoding = encoding |
|
260 | 264 |
parser = expat.ParserCreate() |
261 | 265 |
parser.XmlDeclHandler = xmlDeclHandler |
262 |
parser.Parse(content, True) |
|
266 |
try: |
|
267 |
parser.Parse(content, True) |
|
268 |
except expat.ExpatError as e: |
|
269 |
raise ValueError('invalid XML %s' % e) |
|
263 | 270 |
return xml_encoding |
264 | 271 | |
265 | 272 |
tests/test_sso_slo.py | ||
---|---|---|
115 | 115 |
del self.artifact_message |
116 | 116 |
login.buildResponseMsg() |
117 | 117 |
assert 'rsa-sha256' in login.msgBody |
118 |
return login.msgBody |
|
118 |
return '<?xml version="1.0"?>\n' + login.msgBody
|
|
119 | 119 | |
120 | 120 |
def mock_artifact_resolver(self): |
121 | 121 |
@all_requests |
122 |
- |