File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type WebConfig struct {
2525 // timeout value in seconds
2626 timeout int32
2727 headless bool
28+ leakless bool
2829}
2930
3031func NewWebConf (datadir string ) * WebConfig {
@@ -58,7 +59,7 @@ func New(conf *WebConfig) *Web {
5859 Devtools (false ).
5960 Headless (conf .headless ).
6061 UserDataDir (conf .datadir ).
61- Leakless (true )
62+ Leakless (conf . leakless )
6263
6364 url := l .MustLaunch ()
6465
@@ -76,7 +77,8 @@ func New(conf *WebConfig) *Web {
7677// GetSamlLogin performs a saml login for a given
7778func (web * Web ) GetSamlLogin (conf credentialexchange.CredentialConfig ) (string , error ) {
7879
79- // do not clean up userdata
80+ // close browser even on error
81+ // should cover most cases even with leakless: false
8082 defer web .browser .MustClose ()
8183
8284 web .browser .MustPage (conf .ProviderUrl )
@@ -117,6 +119,7 @@ func (web *Web) GetSSOCredentials(conf credentialexchange.CredentialConfig) (str
117119 defer web .browser .MustClose ()
118120
119121 web .browser .MustPage (conf .ProviderUrl )
122+
120123 router := web .browser .HijackRequests ()
121124 defer router .MustStop ()
122125
You can’t perform that action at this time.
0 commit comments