Skip to content

Commit

Permalink
Merge pull request contentful-labs#59 from axe312ger/patch-1
Browse files Browse the repository at this point in the history
fix tracking headers
  • Loading branch information
Khaledgarbaya authored Mar 30, 2021
2 parents 163dca0 + fbe6f24 commit c2cba1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contentful.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewCMA(token string) *Client {
Headers: map[string]string{
"Authorization": fmt.Sprintf("Bearer %s", token),
"Content-Type": "application/vnd.contentful.management.v1+json",
"X-Contentful-User-Agent": fmt.Sprintf("sdk contentful.go/%s", Version),
"X-Contentful-User-Agent": fmt.Sprintf("sdk contentful-go/%s", Version),
},
BaseURL: "https://api.contentful.com",
Environment: "master",
Expand All @@ -76,7 +76,7 @@ func NewCDA(token string) *Client {
Headers: map[string]string{
"Authorization": "Bearer " + token,
"Content-Type": "application/vnd.contentful.delivery.v1+json",
"X-Contentful-User-Agent": fmt.Sprintf("contentful-go/%s", Version),
"X-Contentful-User-Agent": fmt.Sprintf("sdk contentful-go/%s", Version),
},
BaseURL: "https://cdn.contentful.com",
Environment: "master",
Expand Down
4 changes: 2 additions & 2 deletions contentful_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func TestContentfulNewCMA(t *testing.T) {
assert.Equal(CMAToken, cma.token)
assert.Equal(fmt.Sprintf("Bearer %s", CMAToken), cma.Headers["Authorization"])
assert.Equal("application/vnd.contentful.management.v1+json", cma.Headers["Content-Type"])
assert.Equal(fmt.Sprintf("sdk contentful.go/%s", Version), cma.Headers["X-Contentful-User-Agent"])
assert.Equal(fmt.Sprintf("sdk contentful-go/%s", Version), cma.Headers["X-Contentful-User-Agent"])
}

func TestContentfulNewCDA(t *testing.T) {
Expand All @@ -158,7 +158,7 @@ func TestContentfulNewCDA(t *testing.T) {
assert.Equal(CDAToken, cda.token)
assert.Equal(fmt.Sprintf("Bearer %s", CDAToken), cda.Headers["Authorization"])
assert.Equal("application/vnd.contentful.delivery.v1+json", cda.Headers["Content-Type"])
assert.Equal(fmt.Sprintf("contentful-go/%s", Version), cda.Headers["X-Contentful-User-Agent"])
assert.Equal(fmt.Sprintf("sdk contentful-go/%s", Version), cda.Headers["X-Contentful-User-Agent"])
}

func TestContentfulNewCPA(t *testing.T) {
Expand Down

0 comments on commit c2cba1b

Please sign in to comment.