Skip to content

Commit

Permalink
Update session.go
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiang committed Feb 22, 2025
1 parent 10b458f commit 6118754
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ func (c *Session) AuthToken() string {
//
// Generally Get or a wrapper function will be used instead of Do.
func (c *Session) Do(req *Request) (resp *Response, err error) {
// get Zabbix API version
ver, err := c.GetVersion()
if err != nil {
return nil, fmt.Errorf("Failed to retrieve Zabbix API version: %v", err)
}

// configure request
if ver.Compare(zabbixVersion640) < 0 {
req.AuthToken = c.Token
Expand Down

0 comments on commit 6118754

Please sign in to comment.