This HandshakeHelpers class is a relic of an outdated design. Can you try simplifying this code by merging this method into the UpgradeHandshake class?
You could remove these allocations and query the header collection directly:
|
var headers = new List<KeyValuePair<string, string>>(); |
|
foreach (string headerName in HandshakeHelpers.NeededHeaders) |
|
{ |
|
foreach (var value in _context.Request.Headers.GetCommaSeparatedValues(headerName)) |
|
{ |
|
headers.Add(new KeyValuePair<string, string>(headerName, value)); |
|
} |
|
} |
NeededHeaders can also be removed.
#31311 (comment)
#31311 (comment)