I'm hosting SignalR in an OWIN selfhosted app - in Azure, like so:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
...
Easy enough, works fine. Exposes /signalr/hubs
as expected.
What I would like to do is prevent an HTTP 403.14 when someone hits the /
url. Requesting /
returns an HTTP 403.14:
HTTP Error 403.14 - Forbidden
I think it would be nice to hide OS and hosting details by returning an empty response in case the 'root' url would be hit. So I would like to do this:
app.Map("/", builder => builder.Use((context, func) => context.Response.WriteAsync(string.Empty)));
However - the mapPath argument "/" is not allowed - it cannot end with a slash.
app.Use((context, func) => context.Response.WriteAsync(string.Empty));
This also overwrites the SignalR virtual folder (/signal
) and thus makes the hubs unreachable.
This is the equivalent of having emtpy index.htm pages in web app folders in the old days.