Skip to content

Commit

Permalink
added logging to custom cookie setter including hide sensitive data s…
Browse files Browse the repository at this point in the history
…upport
  • Loading branch information
thejoeker12 committed Jul 9, 2024
1 parent 8f09772 commit 224218c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion httpclient/cookies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (

// loadCustomCookies applies the custom cookies supplied in the config and applies them to the http session.
func (c *Client) loadCustomCookies() error {
c.Sugar.Debug("initilizing cookie jar")

cookieJar, err := cookiejar.New(nil)
if err != nil {
return err
Expand All @@ -15,12 +17,18 @@ func (c *Client) loadCustomCookies() error {
c.http.Jar = cookieJar

cookieUrl, err := url.Parse((*c.Integration).GetFQDN())
c.Sugar.Debug("cookie URL set globally to: %s", cookieUrl)
if err != nil {
return err
}

c.http.Jar.SetCookies(cookieUrl, c.config.CustomCookies)
c.Sugar.Debug("custom cookies set: %v", c.http.Jar.Cookies(cookieUrl))

if c.config.HideSensitiveData {
c.Sugar.Debug("[REDACTED] cookies set successfully")
} else {
c.Sugar.Debug("custom cookies set: %v", c.http.Jar.Cookies(cookieUrl))
}

return nil
}

0 comments on commit 224218c

Please sign in to comment.