Skip to content

Commit a73239c

Browse files
committed
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 <[email protected]>
1 parent f671747 commit a73239c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/saml2/pack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
import base64
11-
import html
11+
import cgi
1212
import logging
1313

1414
import saml2
@@ -87,15 +87,15 @@ def http_form_post_message(message, location, relay_state="",
8787
_msg = _msg.decode('ascii')
8888

8989
saml_response_input = HTML_INPUT_ELEMENT_SPEC.format(
90-
name=html.escape(typ),
91-
val=html.escape(_msg),
90+
name=cgi.escape(typ),
91+
val=cgi.escape(_msg),
9292
type='hidden')
9393

9494
relay_state_input = ""
9595
if relay_state:
9696
relay_state_input = HTML_INPUT_ELEMENT_SPEC.format(
9797
name='RelayState',
98-
val=html.escape(relay_state),
98+
val=cgi.escape(relay_state),
9999
type='hidden')
100100

101101
response = HTML_FORM_SPEC.format(

0 commit comments

Comments
 (0)