Skip to content

Commit

Permalink
Add Credentials.Empty
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 6, 2024
1 parent 5049b77 commit b94bc22
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions common/network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"net/url"
"strconv"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -34,6 +35,15 @@ type Credentials struct {
Password string `js:"password"`
}

// IsEmpty returns true if the credentials are empty.
func (c Credentials) IsEmpty() bool {
c = Credentials{
Username: strings.TrimSpace(c.Username),
Password: strings.TrimSpace(c.Password),
}
return c == (Credentials{})
}

type metricInterceptor interface {
urlTagName(urlTag string, method string) (string, bool)
}
Expand Down

0 comments on commit b94bc22

Please sign in to comment.