File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,11 @@ public WnsServiceBroker (WnsConfiguration configuration) : base (new WnsServiceC
3939 }
4040
4141 public class WnsServiceConnection : IServiceConnection < WnsNotification >
42- {
43- HttpClient http ;
44-
42+ {
4543 public WnsServiceConnection ( WnsConfiguration configuration , WnsAccessTokenManager accessTokenManager )
4644 {
4745 AccessTokenManager = accessTokenManager ;
4846 Configuration = configuration ;
49-
50- //TODO: Microsoft recommends we disable expect-100 to improve latency
51- // Not sure how to do this in httpclient
52- http = new HttpClient ( ) ;
5347 }
5448
5549 public WnsAccessTokenManager AccessTokenManager { get ; private set ; }
@@ -64,6 +58,10 @@ public async Task Send (WnsNotification notification)
6458 //Authorization: Bearer {AccessToken}
6559 //
6660
61+ //TODO: Microsoft recommends we disable expect-100 to improve latency
62+ // Not sure how to do this in httpclient
63+ var http = new HttpClient ( ) ;
64+
6765 http . DefaultRequestHeaders . TryAddWithoutValidation ( "X-WNS-Type" , string . Format ( "wns/{0}" , notification . Type . ToString ( ) . ToLower ( ) ) ) ;
6866 http . DefaultRequestHeaders . TryAddWithoutValidation ( "Authorization" , "Bearer " + accessToken ) ;
6967
You can’t perform that action at this time.
0 commit comments