katana /owin middleware with parameter -
I try to create a parametric middleware, but I only get a error of http 504, it works fine without code parameter
Any thoughts?
Public Zero Configuration (IAppBuilder App) {app.Use & lt; MyMiddleware & gt; ("Hello"); } Classmilemware: Owen Mildware {Public Mimelevelware (OwinMiddleware Next, String Message): Base (Next) {Message = Message; } Public string message {get; Set; } Public override async Task Inococ (IOwinContext context) {context.Response.ContentLength = Message.Length; Context.Response.ContentType = "text / html"; Wait for the reference. reaction. Merger async (message); Wait for further }}
OK I got this issue
Content Length should be evaluated in UTF-8:
encoding. UTF8.GetBytes (message). Unless
C # uses UTF-16 encoding by default < / P>
Comments
Post a Comment