Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set OWIN Response Status Code

Tags:

c#

owin

This should be simple, so I must be missing something basic. In my OWIN app, I want to have a catch-all that redirects to the homepage (index.html).

I see no way in the

public Task Invoke(IDictionary<string, object> environment)

method to return a response code.

like image 943
Greg Bacchus Avatar asked Jul 04 '26 11:07

Greg Bacchus


1 Answers

Regarding the OWIN specification you have to set

environment["owin.ResponseStatusCode"] = 200;

See http://owin.org/spec/owin-1.0.0.html#_3.2._Environment

like image 94
ccellar Avatar answered Jul 07 '26 01:07

ccellar