11using Newtonsoft . Json ;
2- using SteamWebAPI2 . Utilities ;
32using System ;
43using System . Collections . Generic ;
54using System . Diagnostics ;
5+ using System . Linq ;
66using System . Net ;
77using System . Net . Http ;
88using System . Threading . Tasks ;
@@ -122,14 +122,16 @@ private async Task<ISteamWebResponse<T>> SendWebRequestAsync<T>(HttpMethod httpM
122122 httpResponse = await httpClient . PostAsync ( command ) . ConfigureAwait ( false ) ;
123123 }
124124
125+ var headers = httpResponse . Content ? . Headers ;
126+
125127 // extract http headers that we care about
126128 SteamWebResponse < T > steamWebResponse = new SteamWebResponse < T > ( )
127129 {
128- ContentLength = httpResponse . Content . Headers . ContentLength ,
129- ContentType = httpResponse . Content . Headers . ContentType . MediaType ,
130- ContentTypeCharSet = httpResponse . Content . Headers . ContentType . CharSet ,
131- Expires = httpResponse . Content . Headers . Expires ,
132- LastModified = httpResponse . Content . Headers . LastModified ,
130+ ContentLength = headers ? . ContentLength ,
131+ ContentType = headers ? . ContentType ? . MediaType ,
132+ ContentTypeCharSet = headers ? . ContentType ? . CharSet ,
133+ Expires = headers ? . Expires ,
134+ LastModified = headers ? . LastModified ,
133135 } ;
134136
135137 // deserialize the content if we have any as indicated by the response code
@@ -152,7 +154,7 @@ private async Task<ISteamWebResponse<T>> SendWebRequestAsync<T>(HttpMethod httpM
152154 /// <param name="methodVersion">Example: 1</param>
153155 /// <param name="parameters">Example: { key: 8A05823474AB641D684EBD95AB5F2E47 } </param>
154156 /// <returns></returns>
155- private string BuildRequestCommand ( string interfaceName , string methodName , int methodVersion , IList < SteamWebRequestParameter > parameters )
157+ private string BuildRequestCommand ( string interfaceName , string methodName , int methodVersion , IEnumerable < SteamWebRequestParameter > parameters )
156158 {
157159 Debug . Assert ( ! String . IsNullOrWhiteSpace ( interfaceName ) ) ;
158160 Debug . Assert ( ! String . IsNullOrWhiteSpace ( methodName ) ) ;
@@ -166,7 +168,7 @@ private string BuildRequestCommand(string interfaceName, string methodName, int
166168 string commandUrl = String . Format ( "{0}/{1}/{2}/v{3}/" , steamWebApiBaseUrl , interfaceName , methodName , methodVersion ) ;
167169
168170 // if we have parameters, join them together with & delimiter and append them to the command URL
169- if ( parameters != null && parameters . Count > 0 )
171+ if ( parameters != null && parameters . Count ( ) > 0 )
170172 {
171173 string parameterString = String . Join ( "&" , parameters ) ;
172174 commandUrl += String . Format ( "?{0}" , parameterString ) ;
0 commit comments