From d1c34c04be37a354a0965aa464a847dde0494ca3 Mon Sep 17 00:00:00 2001 From: Clement Gutel Date: Wed, 4 Nov 2026 00:01:04 +1100 Subject: [PATCH 1/3] Prefer HTTP/2 for OAuth token requests --- ShopifyNet/OAuth/ShopifyOAuthClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ShopifyNet/OAuth/ShopifyOAuthClient.cs b/ShopifyNet/OAuth/ShopifyOAuthClient.cs index 82940e8..cee18c8 100644 --- a/ShopifyNet/OAuth/ShopifyOAuthClient.cs +++ b/ShopifyNet/OAuth/ShopifyOAuthClient.cs @@ -401,6 +401,8 @@ private async Task RequestAccessTokenAsync(string myShopifyDomain, Diction using var request = new HttpRequestMessage(HttpMethod.Post, $"https://{myShopifyDomain}/admin/oauth/access_token") { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, Content = new FormUrlEncodedContent(parameters) }; request.Headers.Accept.ParseAdd("application/json"); From b8e47b44f1ad8f97bb5bfd41a55506b4d532e109 Mon Sep 17 00:00:00 2001 From: Clement Gutel Date: Wed, 4 Nov 2026 00:03:33 +1100 Subject: [PATCH 2/3] Honor HttpClient default HTTP version and policy --- ShopifyNet/OAuth/ShopifyOAuthClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShopifyNet/OAuth/ShopifyOAuthClient.cs b/ShopifyNet/OAuth/ShopifyOAuthClient.cs index cee18c8..4bacba6 100644 --- a/ShopifyNet/OAuth/ShopifyOAuthClient.cs +++ b/ShopifyNet/OAuth/ShopifyOAuthClient.cs @@ -401,8 +401,8 @@ private async Task RequestAccessTokenAsync(string myShopifyDomain, Diction using var request = new HttpRequestMessage(HttpMethod.Post, $"https://{myShopifyDomain}/admin/oauth/access_token") { - Version = HttpVersion.Version20, - VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + Version = _httpClient.DefaultRequestVersion, + VersionPolicy = _httpClient.DefaultVersionPolicy, Content = new FormUrlEncodedContent(parameters) }; request.Headers.Accept.ParseAdd("application/json"); From dacce790d4155421c961b945e73c7a413ea09e1a Mon Sep 17 00:00:00 2001 From: Clement Gutel Date: Wed, 4 Nov 2026 00:06:09 +1100 Subject: [PATCH 3/3] Default the built-in OAuth HttpClient to HTTP/2 with fallback --- ShopifyNet/OAuth/ShopifyOAuthClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShopifyNet/OAuth/ShopifyOAuthClient.cs b/ShopifyNet/OAuth/ShopifyOAuthClient.cs index 4bacba6..5489389 100644 --- a/ShopifyNet/OAuth/ShopifyOAuthClient.cs +++ b/ShopifyNet/OAuth/ShopifyOAuthClient.cs @@ -44,7 +44,11 @@ public class ShopifyOAuthClient AutomaticDecompression = DecompressionMethods.All, // Token requests must not forward credentials to a redirect target. AllowAutoRedirect = false - }); + }) + { + DefaultRequestVersion = HttpVersion.Version20, + DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrLower + }; private readonly string _clientId; private readonly string _clientSecret;