Describe the bug
I use bellow code to create a static file webserver, because i just want this. It works fine, but i find that there's no ContentLength in the response, it's important for me, Anyone can help me, thanks a lot.
To Reproduce
private static WebServer CreateStaticWebServer(string url, string filePath)
{
var server = new WebServer(
o => o
.WithUrlPrefix(url)
.WithMode(HttpListenerMode.EmbedIO))
.WithLocalSessionManager()
.WithStaticFolder(
"/",
filePath,
true,
m => m.WithContentCaching(false)
).WithModule(
new ActionModule("/",
HttpVerbs.Get,
async ctx => await ctx.SendDataAsync(new { Message = "Error" })
)
);
// Listen for state changes.
server.StateChanged += (s, e) => $"WebServer New State - {e.NewState}".Info();
return server;
}
Expected behavior
Respone with ContentLength in Header.
Describe the bug I use bellow code to create a static file webserver, because i just want this. It works fine, but i find that there's no ContentLength in the response, it's important for me, Anyone can help me, thanks a lot.
To Reproduce
Expected behavior Respone with ContentLength in Header.