mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 14:02:49 +08:00
Web Sockets: work around .NET FX bug (#702)
This commit is contained in:
parent
14cff23d48
commit
fa5892d236
@ -89,9 +89,18 @@ namespace Ocelot.WebSockets.Middleware
|
||||
foreach (var headerEntry in context.Request.Headers)
|
||||
{
|
||||
if (!NotForwardedWebSocketHeaders.Contains(headerEntry.Key, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
client.Options.SetRequestHeader(headerEntry.Key, headerEntry.Value);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// Expected in .NET Framework for headers that are mistakenly considered restricted.
|
||||
// See: https://github.com/dotnet/corefx/issues/26627
|
||||
// .NET Core does not exhibit this issue, ironically due to a separate bug (https://github.com/dotnet/corefx/issues/18784)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var destinationUri = new Uri(serverEndpoint);
|
||||
|
Loading…
x
Reference in New Issue
Block a user