The test was to run the below program, and then have another computer on the same LAN access it.
In this case, the server was at 192.168.1.106, and the client was at 192.168.1.100.
The client would attempt to access a page with the following URL: http://192.168.1.106/addform
import tango.core.Thread;
import tango.io.GrowBuffer;
import tango.io.protocol.Writer;
import tango.net.http.HttpConst;
import tango.util.log.Configurator,
tango.util.log.Log,
tango.util.log.Logger;
import mango.net.http.server.HttpServer,
mango.net.http.server.HttpRequest,
mango.net.http.server.HttpResponse,
mango.net.http.server.HttpProvider;
void main ()
{
// our simple http hander
class Provider : HttpProvider
{
Logger logger;
override void service (HttpRequest request, HttpResponse response)
{
// Get a logger to throw stuff to the console with.
logger = Log.getLogger ("bughunter");
// print all of the header info and stuff.
auto buffer = new GrowBuffer();
auto writer = new Writer(buffer);
request.write(writer);
logger.info("\nrequest debug:\n"~cast(char[])buffer.slice());
// uri path will be full of garbage for a sufficiently long request path (1+ characters)
// and only under certain conditions (in my case, two different client and server
// computers on a LAN)
logger.info("\nrequest uri path: "~request.getRequestUri().getPath());
logger.info("\nrequest uri explicit path: "~request.getExplicitUri().getPath());
// return an HTML page saying "HTTP Error: 200 OK"
response.sendError (HttpResponses.OK);
}
}
// bind server to port 80 on a local address
auto addr = new InternetAddress (80);
// create a (1 thread) server using the ServiceProvider to service requests
auto server = new HttpServer (new Provider, addr, 1, 100);
// start listening for requests (but this thread does not listen)
server.start;
}
The result of running the program under said conditions is as follows:
115405 Info bughunter -
request debug:
§ Accept-Charset: ISO-8☻
9-1,utf-8;q=0.7,*;q
.7
Keep-Alive: 300
Connection: keep-alive
5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plai
n;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
115406 Info bughunter -
request uri path: pt-Chars
115406 Info bughunter -
request uri explicit path: pt-Chars
This bug was not present when running the client and server on the same computer and accessing through 127.0.0.1.
All computers involved were running Windows XP, using Mozilla Firefox, compiling with DMD 1.021, Tango 0.99.1 RC4, and the latest Mango as of Sept 22, 2007.