Open
Description
In some scenarios we want to use to built-in handlers without needing to specify any custom handlers. Unfortunately, this kind of usage will throw a NullReferenceException.
using (var httpServer = new HttpServer(new HttpRequestProvider()))
{
httpServer.Use(new TcpListenerAdapter(new TcpListener(IPAddress.Any, 80)));
httpServer.Use(new FileHandler());
// I don't want to write this line.
httpServer.Use((context, next) => Task.Factory.GetCompleted());
httpServer.Start();
}
I suggest adding a default handler that returns Task.Factory.GetCompleted(), or at least throws a more indicative exception.
Elad