Skip to content

Instantly share code, notes, and snippets.

@powerumc
Last active April 27, 2020 08:04
Show Gist options
  • Save powerumc/d9d4deafb7fd2e2704d3053c639a3d10 to your computer and use it in GitHub Desktop.
Save powerumc/d9d4deafb7fd2e2704d3053c639a3d10 to your computer and use it in GitHub Desktop.
Crash app process if curl without 'Content-Length' http header.
using System;
using Microsoft.Owin.Hosting;
using Owin;
namespace OwinConsoleApp1
{
internal class Program
{
public static void Main(string[] args)
{
var server = WebApp.Start("http://localhost:8080", builder =>
{
builder.Run(context =>
{
context.Response.ContentType = "text/plain";
return context.Response.WriteAsync("world");
});
});
Console.WriteLine("Press any key.");
Console.ReadLine();
server.Dispose();
// typing on terminal without 'Content-Length' http header.
// curl -X POST http://localhost:8080
}
}
}
@powerumc
Copy link
Author

before-patch-owin-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment