Skip to content

Commit 7c236dd

Browse files
committed
address PR review
1 parent 4ba14d4 commit 7c236dd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Http/Owin/src/OwinEnvironment.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,17 @@ private sealed class OwinEntries : IEnumerable<KeyValuePair<string, FeatureMap>>
442442

443443
{ OwinConstants.CommonKeys.ClientCertificate, new FeatureMap<ITlsConnectionFeature>(feature => feature.ClientCertificate, (feature, value) => feature.ClientCertificate = (X509Certificate2)value) },
444444
{ OwinConstants.CommonKeys.LoadClientCertAsync, new FeatureMap<ITlsConnectionFeature>(feature => new Func<Task>(() => feature.GetClientCertificateAsync(CancellationToken.None))) },
445-
{ OwinConstants.WebSocket.AcceptAlt, new FeatureMap<IHttpWebSocketFeature>(feature => new WebSocketAcceptAlt(feature.AcceptAsync)) }
445+
{ OwinConstants.WebSocket.AcceptAlt, new FeatureMap<IHttpWebSocketFeature>(
446+
feature =>
447+
{
448+
if (feature.IsWebSocketRequest)
449+
{
450+
return new WebSocketAcceptAlt(feature.AcceptAsync);
451+
}
452+
453+
return null;
454+
})
455+
}
446456
};
447457

448458
/// <remarks>
@@ -476,8 +486,6 @@ public OwinEntries(HttpContext context)
476486
{
477487
80 => "80",
478488
443 => "443",
479-
8080 => "8080",
480-
8081 => "8081",
481489
_ => port.ToString(CultureInfo.InvariantCulture),
482490
};
483491

0 commit comments

Comments
 (0)