Skip to content

Commit 29a4a2a

Browse files
committed
With --external, save HTML to a file rather than using 'data:' URL
Per private communication, the 'data:' URL might not work in some cases, and it's probably difficult to debug and diagnose such bugs.
1 parent 88027bb commit 29a4a2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gp_saml_gui.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import xml.etree.ElementTree as ET
3030
import ssl
3131
import tempfile
32+
import pathlib
33+
import os
3234

3335
from operator import setitem
3436
from os import path, dup2, execvp, environ
@@ -380,7 +382,9 @@ def main(args = None):
380382
print("Got SAML %s, opening external browser for debugging..." % sam, file=stderr)
381383
import webbrowser
382384
if html:
383-
uri = 'data:text/html;base64,' + b2a_base64(html.encode()).decode()
385+
with tempfile.NamedTemporaryFile(suffix='.html', mode='w', delete=False) as tf:
386+
tf.write(html)
387+
uri = pathlib.Path(tf.name).as_uri()
384388
webbrowser.open(uri)
385389
raise SystemExit
386390

0 commit comments

Comments
 (0)