Skip to content

Commit 6621f11

Browse files
committed
Merge pull request #34 from sharwell/fix-33
Set X-Auth-Token header with indexer instead of Add()
2 parents 9ea53f8 + e2b92bb commit 6621f11

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/corelib/Providers/Rackspace/GeographicalCloudIdentityProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ protected T ExecuteRESTRequest<T>(CloudIdentity identity, string urlPath, HttpMe
431431
var headers = new Dictionary<string, string>();
432432

433433
if (!isTokenRequest)
434-
headers.Add("X-Auth-Token", string.IsNullOrWhiteSpace(token) ? GetToken(identity) : token);
434+
headers["X-Auth-Token"] = string.IsNullOrWhiteSpace(token) ? GetToken(identity) : token;
435435

436436
string bodyStr = null;
437437
if (body != null)

src/corelib/Providers/Rackspace/ProviderBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private T ExecuteRESTRequest<T>(CloudIdentity identity, Uri absoluteUri, HttpMet
7878
if (headers == null)
7979
headers = new Dictionary<string, string>();
8080

81-
headers.Add("X-Auth-Token", IdentityProvider.GetToken(identity, isRetry));
81+
headers["X-Auth-Token"] = IdentityProvider.GetToken(identity, isRetry);
8282

8383
string bodyStr = null;
8484
if (body != null)
@@ -122,7 +122,7 @@ protected Response StreamRESTRequest(CloudIdentity identity, Uri absoluteUri, Ht
122122
if (headers == null)
123123
headers = new Dictionary<string, string>();
124124

125-
headers.Add("X-Auth-Token", IdentityProvider.GetToken(identity, isRetry));
125+
headers["X-Auth-Token"] = IdentityProvider.GetToken(identity, isRetry);
126126

127127
if (string.IsNullOrWhiteSpace(requestSettings.UserAgent))
128128
requestSettings.UserAgent = GetUserAgentHeaderValue();

0 commit comments

Comments
 (0)