Skip to content

Commit 569c64f

Browse files
Merge pull request #772 from peppelinux/unhandled_audience_restr
Correctly handle AudienceRestriction elements with no value
2 parents bc54a8c + f8615e9 commit 569c64f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/saml2/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,10 @@ def for_me(conditions, myself):
216216
if not restriction.audience:
217217
continue
218218
for audience in restriction.audience:
219-
if audience.text.strip() == myself:
219+
if audience.text and audience.text.strip() == myself:
220220
return True
221221
else:
222-
logger.debug("AudienceRestriction - One condition not satisfied: %s != %s" % (audience.text.strip(), myself))
222+
logger.debug("AudienceRestriction - One condition not satisfied: {} != {}".format(audience.text, myself))
223223
logger.debug("AudienceRestrictions not satisfied!")
224224
return False
225225

0 commit comments

Comments
 (0)