diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2021-03-08 00:00:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 00:00:49 +0200 |
commit | 569c64f5f1e1d56191e2a5aae39043be51ed58af (patch) | |
tree | 992a9df00c953da67980f7b239c88aaa1173ba6e | |
parent | bc54a8c7771a5918aa18c0514bd8b641f2519419 (diff) | |
parent | f8615e97126eb429ed837a16a5fbc932746afab1 (diff) | |
download | pysaml2-569c64f5f1e1d56191e2a5aae39043be51ed58af.tar.gz |
Merge pull request #772 from peppelinux/unhandled_audience_restr
Correctly handle AudienceRestriction elements with no value
-rw-r--r-- | src/saml2/response.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py index fcb682b4..26963a04 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -216,10 +216,10 @@ def for_me(conditions, myself): if not restriction.audience: continue for audience in restriction.audience: - if audience.text.strip() == myself: + if audience.text and audience.text.strip() == myself: return True else: - logger.debug("AudienceRestriction - One condition not satisfied: %s != %s" % (audience.text.strip(), myself)) + logger.debug("AudienceRestriction - One condition not satisfied: {} != {}".format(audience.text, myself)) logger.debug("AudienceRestrictions not satisfied!") return False |