diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2018-12-06 10:00:27 +0100 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2018-12-06 10:08:48 +0100 |
commit | a73239c853ddbcc210044381e5ebbc5e7a814fb6 (patch) | |
tree | 6e73aa630fcd764dfd51673d0d3cb8a23b50ada3 /src/saml2 | |
parent | f671747aea352c981333f8b47aaf7a7329471297 (diff) | |
download | pysaml2-a73239c853ddbcc210044381e5ebbc5e7a814fb6.tar.gz |
Use cgi instead of html module
The html module is only available for python3. The cgi module provides almost
identical functionality and is present for both python2 and python3.
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'src/saml2')
-rw-r--r-- | src/saml2/pack.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saml2/pack.py b/src/saml2/pack.py index c60ee5ad..b447be31 100644 --- a/src/saml2/pack.py +++ b/src/saml2/pack.py @@ -8,7 +8,7 @@ Bindings normally consists of three parts: """ import base64 -import html +import cgi import logging import saml2 @@ -87,15 +87,15 @@ def http_form_post_message(message, location, relay_state="", _msg = _msg.decode('ascii') saml_response_input = HTML_INPUT_ELEMENT_SPEC.format( - name=html.escape(typ), - val=html.escape(_msg), + name=cgi.escape(typ), + val=cgi.escape(_msg), type='hidden') relay_state_input = "" if relay_state: relay_state_input = HTML_INPUT_ELEMENT_SPEC.format( name='RelayState', - val=html.escape(relay_state), + val=cgi.escape(relay_state), type='hidden') response = HTML_FORM_SPEC.format( |