File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
coinapi/market-data-api-rest/sdk-handcrafted/csharp-rest/CoinAPI.REST.V1 Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1616 <PackageLicenseFile >LICENSE</PackageLicenseFile >
1717 <Company >COINAPI LTD</Company >
1818 <Copyright >COINAPI LTD or its affiliates</Copyright >
19- <Version >3.2.4 </Version >
19+ <Version >3.2.5 </Version >
2020 <UserSecretsId >17704ec2-7050-452e-99b5-0eddf76dea5d</UserSecretsId >
2121 </PropertyGroup >
2222
Original file line number Diff line number Diff line change @@ -16,19 +16,23 @@ public static class HttpClientFactory
1616
1717 public static HttpClient GetClient ( string apiKey )
1818 {
19- if ( ! clients . TryGetValue ( apiKey , out HttpClient client ) )
19+ lock ( clients )
2020 {
21- var handler = new HttpClientHandler
21+ if ( ! clients . TryGetValue ( apiKey , out HttpClient client ) )
2222 {
23- AutomaticDecompression = DecompressionMethods . GZip | DecompressionMethods . Deflate
24- } ;
25- client = new HttpClient ( handler ) ;
26- client . DefaultRequestHeaders . Add ( "X-CoinAPI-Key" , apiKey ) ;
27- clients [ apiKey ] = client ;
23+ var handler = new HttpClientHandler
24+ {
25+ AutomaticDecompression = DecompressionMethods . GZip | DecompressionMethods . Deflate
26+ } ;
27+ client = new HttpClient ( handler ) ;
28+ client . DefaultRequestHeaders . Add ( "X-CoinAPI-Key" , apiKey ) ;
29+ clients [ apiKey ] = client ;
30+ }
31+ return client ;
2832 }
29- return client ;
3033 }
3134 }
35+
3236 public class CoinApiRestClient
3337 {
3438 private string apiKey ;
You can’t perform that action at this time.
0 commit comments