dotnet / WatsonWebserver

Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
MIT License
411 stars 84 forks source link

ContentHandler missing from Version 6.1.1 #126

Closed john144 closed 11 months ago

john144 commented 11 months ago

I tried to create a new app from scratch using Watson Webserver, but NuGet served me version 6.1.1, but unfortunately the ContentHandler that you added to version 6.0.3 is missing from 6.1.1. Consequently, this statement now gives me a compile error:

_Server.Routes.PreAuthentication.ContentHandler = new ContentRouteHandler(_Server.Routes.PreAuthentication.Content);

I uninstalled 6.1.1 and installed 6.0.3, and it now compiles OK.

jchristn commented 11 months ago

Hi @john144 please pardon my oversight, I forgot to commit the code that was in the v6.1.1 NuGet package. It is now committed and can be found here: https://github.com/dotnet/WatsonWebserver/commit/56d61d719b9e13c8b86bc64c3b6a374702a601c4

ContentRouteHandler is now a property of ContentRouteManager, e.g. Webserver.Routes.PreAuthentication.Content now has an Func<HttpContextBase, Task> that can be overridden. The default body for this function is the original ContentRouteHandler. The reason I did this was to clean up configuration of routes and also to allow the HostBuilder extension to work for folks that wanted to map content routes while using that extension.

Please re-open if any issues!