Last active
April 27, 2020 08:04
-
-
Save powerumc/d9d4deafb7fd2e2704d3053c639a3d10 to your computer and use it in GitHub Desktop.
Crash app process if curl without 'Content-Length' http header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} | |
} |
Author
powerumc
commented
Apr 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment