Clean PEM file before including them in the metadata

This commit is contained in:
Benjamin Dauvergne 2014-11-17 16:32:29 +01:00
parent 42f389e416
commit 4112e4b153
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ def create_metadata(request):
public_keys = []
for public_key in app_settings.PUBLIC_KEYS:
if public_key.startswith('/'):
public_key = file(public_key).read()
# clean PEM file
public_key = ''.join(file(public_key).read().splitlines()[1:-1])
public_keys.append(public_key)
name_id_formats = app_settings.NAME_ID_FORMATS
return render_to_string('mellon/metadata.xml', {