Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cloudconnexa/cloudconnexa.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Client struct {
VPNRegions *VPNRegionsService
LocationContexts *LocationContextsService
AccessGroups *AccessGroupsService
Settings *SettingsService
}

type service struct {
Expand Down Expand Up @@ -134,6 +135,7 @@ func NewClient(baseURL, clientID, clientSecret string) (*Client, error) {
c.VPNRegions = (*VPNRegionsService)(&c.common)
c.LocationContexts = (*LocationContextsService)(&c.common)
c.AccessGroups = (*AccessGroupsService)(&c.common)
c.Settings = (*SettingsService)(&c.common)
return c, nil
}

Expand All @@ -147,7 +149,9 @@ func (c *Client) DoRequest(req *http.Request) ([]byte, error) {

req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.Token))
req.Header.Set("User-Agent", c.UserAgent)
req.Header.Set("Content-Type", "application/json")
if req.Header.Get("Content-Type") == "" {
req.Header.Set("Content-Type", "application/json")
}

res, err := c.client.Do(req)
if err != nil {
Expand Down
Loading