From 0f60ca3c3021bbda4ae0737d713bf536bcbb51fd Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Fri, 31 May 2024 16:51:45 +0800 Subject: [PATCH] fix deserialization error when api was not en-US --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 52d78bdce8..5038b2a247 100644 --- a/main.go +++ b/main.go @@ -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() @@ -17,5 +19,10 @@ func NewAPIClientFor(host string, token string) *APIClient { fmt.Sprintf(authHeaderFormat, token), ) + cfg.AddDefaultHeader( + languageHeaderName, + languageHeaderValue, + ) + return NewAPIClient(cfg) }