Skip to content

Commit

Permalink
Fix bug with multiple HTTP headers in batch requests. Fixes #548.
Browse files Browse the repository at this point in the history
  • Loading branch information
erickoledadevrel committed Jun 9, 2015
1 parent d78d382 commit 86fc72c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Src/GoogleApis/Apis/Requests/BatchRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ internal static HttpResponseMessage ParseAsHttpResponse(string content)
while (!string.IsNullOrEmpty((line = reader.ReadLine())))
{
var separatorIndex = line.IndexOf(':');
headersDic.Add(line.Substring(0, separatorIndex).Trim(),
line.Substring(separatorIndex + 1).Trim());
var key = line.Substring(0, separatorIndex).Trim();
var value = line.Substring(separatorIndex + 1).Trim();
if (headersDic.ContainsKey(key)) {
headersDic[key] = headersDic[key] + ", " + value;
} else {
headersDic.Add(key, value);
}
}

// Set the content.
Expand Down

0 comments on commit 86fc72c

Please sign in to comment.