Skip to content

Commit

Permalink
Make sure we treat response headers from the server as case insensitive
Browse files Browse the repository at this point in the history
On the mac, the browser modify the header names
  • Loading branch information
ayende committed Nov 10, 2011
1 parent 3e057fd commit ee4e545
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Raven.Client.Silverlight/Connection/HttpJsonRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,14 @@ private T ReadResponse<T>(Func<WebResponse> getResponse, Func<Stream, T> handleR
}
}

ResponseHeaders = response.Headers.AllKeys
.ToDictionary(key => key, key => (IList<string>)new List<string> { response.Headers[key] });
ResponseHeaders = new Dictionary<string, IList<string>>(StringComparer.InvariantCultureIgnoreCase);
foreach (var key in response.Headers.AllKeys)
{
ResponseHeaders[key] = new List<string>
{
response.Headers[key]
};
}
ResponseStatusCode = ((HttpWebResponse)response).StatusCode;

using (var responseStream = response.GetResponseStream())
Expand Down

0 comments on commit ee4e545

Please sign in to comment.