Merge branch 'benaadams/connectionfilter' into dev
This commit is contained in:
commit
7cbbf68e9d
|
|
@ -36,9 +36,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Https
|
|||
_previous = previous;
|
||||
}
|
||||
|
||||
public async Task OnConnection(ConnectionFilterContext context)
|
||||
public async Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
await _previous.OnConnection(context);
|
||||
await _previous.OnConnectionAsync(context);
|
||||
|
||||
if (string.Equals(context.Address.Scheme, "https", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
|
|||
{
|
||||
public interface IConnectionFilter
|
||||
{
|
||||
Task OnConnection(ConnectionFilterContext context);
|
||||
Task OnConnectionAsync(ConnectionFilterContext context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
|
|||
_previous = previous;
|
||||
}
|
||||
|
||||
public async Task OnConnection(ConnectionFilterContext context)
|
||||
public async Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
await _previous.OnConnection(context);
|
||||
await _previous.OnConnectionAsync(context);
|
||||
|
||||
context.Connection = new LoggingStream(context.Connection, _logger);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Filter
|
|||
{
|
||||
public class NoOpConnectionFilter : IConnectionFilter
|
||||
{
|
||||
public Task OnConnection(ConnectionFilterContext context)
|
||||
public Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
return TaskUtilities.CompletedTask;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
|||
|
||||
try
|
||||
{
|
||||
ConnectionFilter.OnConnection(_filterContext).ContinueWith((task, state) =>
|
||||
ConnectionFilter.OnConnectionAsync(_filterContext).ContinueWith((task, state) =>
|
||||
{
|
||||
var connection = (Connection)state;
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
|
||||
private RewritingStream _rewritingStream;
|
||||
|
||||
public Task OnConnection(ConnectionFilterContext context)
|
||||
public Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
_rewritingStream = new RewritingStream(context.Connection);
|
||||
context.Connection = _rewritingStream;
|
||||
|
|
@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
|
||||
private class AsyncConnectionFilter : IConnectionFilter
|
||||
{
|
||||
public async Task OnConnection(ConnectionFilterContext context)
|
||||
public async Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
var oldConnection = context.Connection;
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
|||
|
||||
private class ThrowingConnectionFilter : IConnectionFilter
|
||||
{
|
||||
public Task OnConnection(ConnectionFilterContext context)
|
||||
public Task OnConnectionAsync(ConnectionFilterContext context)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue