nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 308 forks source link

Fix disposal of InternalHttpClientFactory's static HttpClient #1006

Closed nozzlegear closed 7 months ago

nozzlegear commented 7 months ago

This pull request fixes a bug with the ShopifyOauthUtility.RefreshAccessTokenAsync method, which was erroneously disposing the static HttpClient in ShopifySharp's InternalHttpClientFactory. If the developer did not supply their own IHttpClientFactory to the ShopifyService via ShopifyService.SetHttpClientFactory, then any service that attempted to call the Shopify API after the disposal would throw an ObjectDisposedException for the lifetime of the application.

See #1005 for more info.