Skip to content

Commit d440116

Browse files
Merge pull request #758 from peppelinux/statusresp_return_addrs
Fix StatusResponse when return_addrs is not set
2 parents 87be05b + d2e775a commit d440116

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/saml2/response.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class StatusResponse(object):
255255
def __init__(self, sec_context, return_addrs=None, timeslack=0,
256256
request_id=0, asynchop=True, conv_info=None):
257257
self.sec = sec_context
258-
self.return_addrs = return_addrs
258+
self.return_addrs = return_addrs or []
259259

260260
self.timeslack = timeslack
261261
self.request_id = request_id
@@ -402,10 +402,11 @@ def _verify(self):
402402
raise RequestVersionTooHigh()
403403

404404
if self.asynchop:
405-
if self.response.destination and \
406-
self.response.destination not in self.return_addrs:
407-
logger.error("%s not in %s", self.response.destination,
408-
self.return_addrs)
405+
if (
406+
self.response.destination
407+
and self.response.destination not in self.return_addrs
408+
):
409+
logger.error("%s not in %s", self.response.destination, self.return_addrs)
409410
return None
410411

411412
valid = self.issue_instant_ok() and self.status_ok()

0 commit comments

Comments
 (0)