From e9d406e2f71a2720c0d990a2cb809e156a465ca2 Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 12 Jun 2015 15:58:15 -0700 Subject: [PATCH] React to OnSendingHeaders rename. --- src/Microsoft.AspNet.Session/SessionMiddleware.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Session/SessionMiddleware.cs b/src/Microsoft.AspNet.Session/SessionMiddleware.cs index 3496de13b3..57c1d8f5b9 100644 --- a/src/Microsoft.AspNet.Session/SessionMiddleware.cs +++ b/src/Microsoft.AspNet.Session/SessionMiddleware.cs @@ -92,10 +92,10 @@ namespace Microsoft.AspNet.Session _context = context; _sessionKey = sessionKey; _options = options; - context.Response.OnSendingHeaders(OnSendingHeadersCallback, state: this); + context.Response.OnResponseStarting(OnResponseStartingCallback, state: this); } - private static void OnSendingHeadersCallback(object state) + private static void OnResponseStartingCallback(object state) { var establisher = (SessionEstablisher)state; if (establisher._shouldEstablishSession) @@ -131,7 +131,7 @@ namespace Microsoft.AspNet.Session // Returns true if the session has already been established, or if it still can be because the response has not been sent. internal bool TryEstablishSession() { - return (_shouldEstablishSession |= !_context.Response.HeadersSent); + return (_shouldEstablishSession |= !_context.Response.HasStarted); } } }