puzzling.org’s wacky behaviour

For ages now the puzzling.org website has had a regular bug whereby instead of displaying correctly it would dump a bunch of HTTP headers and HTML in plain text to people’s web browsers. I’ve known about it for at least a year and people have been emailing me periodically.

This should now be fixed. The problem was Twisted Web/Nevow’s implementation of HTTP’s 304 code (not modified). At least in the Twisted versions in Ubuntu Hardy and possibly still in trunk twisted.web returns a body of data as well as that header, which is an HTTP MUST NOT. (twisted.web2 looks like it gets this right, we didn’t check for sure.)

If it continues to happen and you’re one of the few and far between people who wants to help me debug the rarely used HTTP implementation that runs my website, tcpdumps (all traffic, don’t limit the packet size) are the most useful debugging tool. At least I’ll know where to look in future.