Use new HttpContext.Features API.

This commit is contained in:
Chris R 2015-08-31 09:45:21 -07:00
parent 821f470bb5
commit 6bc7df851f
1 changed files with 3 additions and 3 deletions

View File

@ -29,12 +29,12 @@ namespace Microsoft.AspNet.WebSockets.Server
public Task Invoke(HttpContext context) public Task Invoke(HttpContext context)
{ {
// Detect if an opaque upgrade is available. If so, add a websocket upgrade. // Detect if an opaque upgrade is available. If so, add a websocket upgrade.
var upgradeFeature = context.GetFeature<IHttpUpgradeFeature>(); var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
if (upgradeFeature != null) if (upgradeFeature != null)
{ {
if (_options.ReplaceFeature || context.GetFeature<IHttpWebSocketFeature>() == null) if (_options.ReplaceFeature || context.Features.Get<IHttpWebSocketFeature>() == null)
{ {
context.SetFeature<IHttpWebSocketFeature>(new UpgradeHandshake(context, upgradeFeature, _options)); context.Features.Set<IHttpWebSocketFeature>(new UpgradeHandshake(context, upgradeFeature, _options));
} }
} }