Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Added OnResponseCompleted to HttpResponse #196

Merged
merged 1 commit into from
Mar 17, 2015
Merged

Conversation

ajaybhargavb
Copy link
Contributor

@ghost ghost added the cla-not-required label Feb 19, 2015
@@ -6,9 +6,6 @@
using System.IO;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unnecessary usings.

@@ -155,6 +155,16 @@ void IHttpResponseFeature.OnSendingHeaders(Action<object> callback, object state
register(callback, state);
}

void IHttpResponseFeature.OnResponseCompleted(Action<object> callback, object state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This?

void IHttpResponseFeature.OnSendingHeaders(Action<object> callback, object state)
{
var register = Prop<Action<Action<object>, object>>(OwinConstants.CommonKeys.OnSendingHeaders);
if (register == null)
{
throw new NotSupportedException(OwinConstants.CommonKeys.OnSendingHeaders);
}
register(callback, state);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, the code you pointed supports calling the server.OnSendingHeaders callback from ASP.NET 5, but can't inject server.OnSendingHeaders in the OWIN environment, which is what the OwinEnvironment class does.

Anyway, @Tratcher said they were only using community defined keys.

@kevinchalet
Copy link
Contributor

Have you considered making this new hook async?

Related discussion (concerning OSH): aspnet/Security#76

@@ -70,6 +70,7 @@ internal static class CommonKeys
public const string AppName = "host.AppName";
public const string Capabilities = "server.Capabilities";
public const string OnSendingHeaders = "server.OnSendingHeaders";
public const string OnResponseCompleted = "server.OnResponseCompleted";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a key http://owin.org/spec/spec/CommonKeys.html

@lodejard
Copy link
Contributor

lodejard commented Mar 4, 2015

:shipit:

@davidfowl
Copy link
Member

@ajaybhargavb rebase this

@ajaybhargavb
Copy link
Contributor Author

Rebased.

@davidfowl
Copy link
Member

:shipit:

@ajaybhargavb
Copy link
Contributor Author

Can you also look at all the related PRs?

@ajaybhargavb ajaybhargavb merged commit f637027 into dev Mar 17, 2015
@Tratcher Tratcher deleted the response-feature branch May 6, 2015 17:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants