Skip to content

Commit 159be83

Browse files
author
Cory Thompson
committed
2 parents 64747e7 + 237457d commit 159be83

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

WebPush/WebPushClient.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@ public class WebPushClient
1717

1818
private string _gcmApiKey;
1919
private HttpClient _httpClient;
20+
private readonly HttpClientHandler _httpClientHandler;
2021
private VapidDetails _vapidDetails;
2122

23+
public WebPushClient(HttpClientHandler httpClientHandler=null)
24+
{
25+
_httpClientHandler = httpClientHandler;
26+
}
27+
2228
protected HttpClient HttpClient
2329
{
2430
get
2531
{
2632
if (_httpClient == null)
2733
{
28-
_httpClient = new HttpClient();
34+
_httpClient = _httpClientHandler == null
35+
? new HttpClient()
36+
: new HttpClient(_httpClientHandler);
37+
2938
}
3039

3140
return _httpClient;

0 commit comments

Comments
 (0)