Skip to content

Commit c9e7831

Browse files
mildsunrisedlenski
authored andcommitted
fix exception when checking about:blank response
the current code doesn't make much sense -- if an HTTP response is not present, it sets 'h' to None... but then proceeds to do stuff with 'h' assuming it has some value.
1 parent 258f47c commit c9e7831

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
@@ -124,11 +124,15 @@ def on_load_changed(self, webview, event):
124124
uri = mr.get_uri()
125125
rs = mr.get_response()
126126
h = rs.get_http_headers() if rs else None
127-
ct = h.get_content_type()
127+
ct = h.get_content_type() if h else None
128128

129129
if self.verbose:
130130
print('[PAGE ] Finished loading page %s' % uri, file=stderr)
131131

132+
# if no response or no headers (for e.g. about:blank), skip checking this
133+
if not rs or not h:
134+
return
135+
132136
# convert to normal dict
133137
d = {}
134138
h.foreach(lambda k, v: setitem(d, k.lower(), v))

0 commit comments

Comments
 (0)