Skip to content

Commit

Permalink
Merge pull request Squirrel#224 from BarryThePenguin/master
Browse files Browse the repository at this point in the history
Do not send null token in Authorization Header
  • Loading branch information
anaisbetts committed Feb 10, 2015
2 parents 7c74831 + 20f6e34 commit e9a1986
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SyncReleases/SyncImplementations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ await retryAsync(3, async () => {
var rq = new HttpRequestMessage(HttpMethod.Get, x.Url);
rq.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/octet-stream"));
rq.Headers.UserAgent.Add(new System.Net.Http.Headers.ProductInfoHeaderValue(userAgent.Name, userAgent.Version));
rq.Headers.Add("Authorization", "Bearer " + token);
if (token != null) {
rq.Headers.Add("Authorization", "Bearer " + token);
}
var resp = await hc.SendAsync(rq);
resp.EnsureSuccessStatusCode();
Expand Down

0 comments on commit e9a1986

Please sign in to comment.