Skip to content

Commit

Permalink
fix deserialization error when api was not en-US
Browse files Browse the repository at this point in the history
  • Loading branch information
iceking2nd committed May 31, 2024
1 parent 310bff3 commit 0f60ca3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (

const authHeaderName = "Authorization"
const authHeaderFormat = "Token %v"
const languageHeaderName = "Accept-Language"
const languageHeaderValue = "en-US"

func NewAPIClientFor(host string, token string) *APIClient {
cfg := NewConfiguration()
Expand All @@ -17,5 +19,10 @@ func NewAPIClientFor(host string, token string) *APIClient {
fmt.Sprintf(authHeaderFormat, token),
)

cfg.AddDefaultHeader(
languageHeaderName,
languageHeaderValue,
)

return NewAPIClient(cfg)
}

0 comments on commit 0f60ca3

Please sign in to comment.