Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Accept header to application/json #34

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## 0.6.0
## 0.6.1
* Set Accept header to application/json

## 0.6.0
* Add version to User-Agent header
* Add WithUserAgent option to enable customization of the User-Agent header
4 changes: 3 additions & 1 deletion scryfall.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const (
Version = "0.6.0"
Version = "0.6.1"

defaultBaseURL = "https://api.scryfall.com"
defaultUserAgent = "go-scryfall/" + Version
Expand Down Expand Up @@ -223,6 +223,8 @@ func NewClient(options ...ClientOption) (*Client, error) {

func (c *Client) doReq(ctx context.Context, req *http.Request, respBody interface{}) error {
req.Header.Set("User-Agent", c.userAgent)
req.Header.Set("Accept", "application/json")

if len(c.authorization) != 0 {
req.Header.Set("Authorization", c.authorization)
}
Expand Down
Loading