Skip to content

Commit 0546383

Browse files
Fixes issue with handling multiple headers with same name in DevToolsPlugin. Closes #1169
1 parent 5001dd5 commit 0546383

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dev-proxy-plugins/Inspection/DevToolsPlugin.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ private async Task BeforeRequestAsync(object sender, ProxyRequestArgs e)
240240

241241
var requestId = GetRequestId(e.Session.HttpClient.Request);
242242
var headers = e.Session.HttpClient.Request.Headers
243-
.ToDictionary(h => h.Name, h => h.Value);
243+
.GroupBy(h => h.Name)
244+
.ToDictionary(g => g.Key, g => string.Join(", ", g.Select(h => h.Value)));
244245

245246
var requestWillBeSentMessage = new RequestWillBeSentMessage
246247
{
@@ -323,7 +324,8 @@ private async Task AfterResponseAsync(object sender, ProxyResponseArgs e)
323324
Status = e.Session.HttpClient.Response.StatusCode,
324325
StatusText = e.Session.HttpClient.Response.StatusDescription,
325326
Headers = e.Session.HttpClient.Response.Headers
326-
.ToDictionary(h => h.Name, h => h.Value),
327+
.GroupBy(h => h.Name)
328+
.ToDictionary(g => g.Key, g => string.Join(", ", g.Select(h => h.Value))),
327329
MimeType = e.Session.HttpClient.Response.ContentType
328330
}
329331
}

0 commit comments

Comments
 (0)