2.0 file server confusion

Apr 24, 2010 at 2:40 AM


Been working with 2.0 for a couple of days and have come across a few documentation/example bugs:

1) The HttpServer does it's own file serving if given a suitable resource

m_httpServer.Resources.Add(new FileResources("/files", "C:\\files\\"));

2) The examples show that the FileModule can be used like this:

m_httpServer.Resources.Add(new FileResources("/files", "C:\\files\\"));
m_httpServer.Add(new FileModule(m_httpServer.Resources, true));

but it is wrong, as the inbuilt HttpServer file handling gets in first

3) To use the FileModule do something like this:

ResourceProvider resources = new ResourceProvider();
resources.Add(new FileResources("/files", "C:\\files\\"));
m_httpServer.Add(new FileModule(resources, true));

4) The HttpServer code doesn't handle Last-Modified as well as the FileModule, in particular it doesn't set the mime type when sending a last-modified header and no content.

5) Please document the various useful stuff in HtppServer: i.e. .Abort, .SendResponse etc.

Thanks for the great work!



May 11, 2010 at 7:39 AM

*erhm* well... I forgot about the file module ;)

I'll start using it again instead of the methods in the webserver class.