Menu

#2 KtoHTTPD can not handle basic HTTP requests without headers.

open
nobody
None
5
2012-07-08
2012-07-08
philipp
No

KtoHTTPD can not handle basic HTTP requests without headers. The current version (2010-11-12) fails with an Exception if a request like "GET / HTTP/1.1" (without headers) is received. No page is served. This can be tested by opening a simple connection (e.g. telnet) and sending just the string.

In the original NanoHTTP they fixed this with the following changes:

347c347
< f.write(buf, splitbyte, rlen-splitbyte);
---
> if (splitbyte < rlen) f.write(buf, splitbyte, rlen-splitbyte);
477c477
< while ( line.trim().length() > 0 )
---
> while ( line != null && line.trim().length() > 0 )

Discussion


Log in to post a comment.

MongoDB Logo MongoDB