Skip to content

Commit

Permalink
chore: prepare http roundtripper to accept new userAgent (#1336)
Browse files Browse the repository at this point in the history
chore: prepare http roundtripper accept new userAgent
  • Loading branch information
geffersonFerraz authored Jan 23, 2025
1 parent 5757410 commit 2991a18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mgc/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sdk
import (
"context"
"net/http"
"strings"

"github.com/MagaluCloud/magalu/mgc/core"
"github.com/MagaluCloud/magalu/mgc/core/auth"
Expand Down Expand Up @@ -123,6 +124,9 @@ func (o *Sdk) Group() core.Grouper {
func newHttpTransport() http.RoundTripper {
userAgent := currentUserAgent + "/" + Version

if strings.HasPrefix(currentUserAgent, "MgcTF") {
userAgent = currentUserAgent
}
// To avoid creating a transport with zero values, we leverage
// DefaultTransport (exemple: `Proxy: ProxyFromEnvironment`)
transport := mgcHttpPkg.DefaultTransport()
Expand Down

0 comments on commit 2991a18

Please sign in to comment.