Skip to content

Commit

Permalink
client.go: Remove default ios platform to unbreak GET subscribers/ ca…
Browse files Browse the repository at this point in the history
…ll (#6)
  • Loading branch information
HaraldNordgren authored Apr 24, 2024
1 parent f134572 commit e0674f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ func (c *Client) call(method, path string, reqBody interface{}, platform string,
req.Header.Add("Authorization", "Bearer "+c.apiKey)
req.Header.Add("Content-Type", "application/json")

if platform == "" {
platform = "ios"
if platform != "" {
req.Header.Add("X-Platform", platform)
}
req.Header.Add("X-Platform", platform)

resp, err := c.http.Do(req)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion purchases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestCreatePurchaseWithoutOpts(t *testing.T) {

cl.expectMethod(t, "POST")
cl.expectPath(t, "/v1/receipts")
cl.expectXPlatform(t, "ios")
cl.expectXPlatform(t, "")
cl.expectBody(t, `{"app_user_id":"123","fetch_token":"testreceipt"}`)
}

Expand Down

0 comments on commit e0674f4

Please sign in to comment.