diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-09-29 13:40:02 +0300 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-09-29 13:40:02 +0300 |
commit | d62a10c473f64e389d2d26958c83c83daafe38fd (patch) | |
tree | 39da14c7aab3de81b25c0c5f6f52d9c67d024d41 | |
parent | ecc690ef8b4b4a4f7564f042ab97e4e6c66bf7be (diff) | |
download | pysaml2-d62a10c473f64e389d2d26958c83c83daafe38fd.tar.gz |
Support both str and bytes SAML requests on the example idp
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rwxr-xr-x | example/idp2/idp.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/example/idp2/idp.py b/example/idp2/idp.py index 83e5dfce..0b075d79 100755 --- a/example/idp2/idp.py +++ b/example/idp2/idp.py @@ -109,7 +109,12 @@ class Service(object): return None def unpack_post(self): - _dict = parse_qs(get_post(self.environ)) + post_data = get_post(self.environ) + _dict = parse_qs( + post_data + if isinstance(post_data, str) + else post_data.decode('utf-8') + ) logger.debug("unpack_post:: %s", _dict) try: return dict([(k, v[0]) for k, v in _dict.items()]) |