From d5ac9061b341bd307a4e83ef92bdf01be73dfd23 Mon Sep 17 00:00:00 2001 From: Fabio Vilela Date: Tue, 14 Nov 2023 15:22:02 +1100 Subject: [PATCH 1/2] set a default user agent so Zendesk can identify the requests are coming from this SDK --- src/ZendeskApi.Client/ZendeskApiClient.cs | 3 ++- src/ZendeskApi.Client/ZendeskApiClientFactory.cs | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ZendeskApi.Client/ZendeskApiClient.cs b/src/ZendeskApi.Client/ZendeskApiClient.cs index 761a4a7e..584a35ec 100644 --- a/src/ZendeskApi.Client/ZendeskApiClient.cs +++ b/src/ZendeskApi.Client/ZendeskApiClient.cs @@ -52,6 +52,7 @@ public HttpClient CreateClient(string resource = null) var authorizationHeader = _options.GetAuthorizationHeader(); client.DefaultRequestHeaders.Add("Authorization", authorizationHeader); + client.DefaultRequestHeaders.UserAgent.ParseAdd("justeat.zendesk-api-client-csharp"); client.DefaultRequestHeaders .Accept @@ -73,7 +74,7 @@ public HttpClient CreateServiceStatusClient() { BaseAddress = new Uri("https://status.zendesk.com") }; - + client.DefaultRequestHeaders.UserAgent.ParseAdd("justeat.zendesk-api-client-csharp"); client.DefaultRequestHeaders .Accept .Add(new MediaTypeWithQualityHeaderValue("application/json")); diff --git a/src/ZendeskApi.Client/ZendeskApiClientFactory.cs b/src/ZendeskApi.Client/ZendeskApiClientFactory.cs index 8a3f0a83..4b85beb3 100644 --- a/src/ZendeskApi.Client/ZendeskApiClientFactory.cs +++ b/src/ZendeskApi.Client/ZendeskApiClientFactory.cs @@ -38,8 +38,9 @@ public HttpClient CreateClient(string resource = null) client.DefaultRequestHeaders .Add( - "Authorization", + "Authorization", authorizationHeader); + client.DefaultRequestHeaders.UserAgent.ParseAdd("justeat.zendesk-api-client-csharp"); client.DefaultRequestHeaders .Accept @@ -57,7 +58,7 @@ public HttpClient CreateServiceStatusClient() .CreateClient(); client.BaseAddress = new Uri("https://status.zendesk.com"); - + client.DefaultRequestHeaders.UserAgent.ParseAdd("justeat.zendesk-api-client-csharp"); client.DefaultRequestHeaders .Accept .Add(new MediaTypeWithQualityHeaderValue("application/json")); @@ -68,4 +69,4 @@ public HttpClient CreateServiceStatusClient() return client; } } -} \ No newline at end of file +} From f4dae7a68d3cc7af30dd89b60ffbb1662d61fe1c Mon Sep 17 00:00:00 2001 From: Fabio Vilela Date: Thu, 16 Nov 2023 15:07:41 +1100 Subject: [PATCH 2/2] bump version --- src/ZendeskApi.Build/ZendeskApi.Commons.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZendeskApi.Build/ZendeskApi.Commons.props b/src/ZendeskApi.Build/ZendeskApi.Commons.props index 3b52fe62..8c512508 100644 --- a/src/ZendeskApi.Build/ZendeskApi.Commons.props +++ b/src/ZendeskApi.Build/ZendeskApi.Commons.props @@ -23,7 +23,7 @@ 7 0 - 5 + 6 $(Major).$(Minor).$(Revision)