Sunday, May 20, 2007

Then a month flew past

And I started a gazillion new projects without finishing any of the others. I must try to think of what it was I did in all that time.

I've just been searching for help for a problem I'm having with IE7. I'm writing a web server to manage a community site that allows access to some local hardware, so I use several different browsers to make sure requests are handled correctly, pages display correctly etc.

It's all going fairly well. I've used a browser almost every time I've touched a computer since I fell in love with NCSA's Mosaic in my first year at uni in 1993. I rarely encounter really awful problems with browsers, they always seem to JustWork(TM). OK, maybe I've got loyal habits, I've followed the Mosaic, Navigator, Firefox path, and only now am I looking at other browsers to make sure I'm not sending goop to people with more adventurous (or commercial) tastes.

Having looked at what a browser sends to a web server, I can't believe all this stuff seems to work so well! I'm writing my web server in Java, just plain old SE, no bells or whistles, so I'm parsing all the requests with my own code. It's a nightmare in there! If you're in the business of writing popular web servers, then you have my respect.

Anyway, back to IE7. I see people having the same problem, but no really helpful replies. My web server uses a cookie to track a user's session. When I browse my site with IE7, I can follow links OK, but on one page, can't use the 'back' button. IE7 gives me one of its very clear, but ultimately very useless, error pages:

(i) Webpage has expired

I include no expiry data in the pages I'm serving (yet), and using the 'back' function in some of the other browsers I'm testing (Firefox, Gecko, Konqueror) works exactly as expected. The page it happens on is generated by a POST request from the previous page - a file upload. That page includes thumbnails with links to original documents. I press the back button on the page with the original document displayed on it, to get the error in IE7.

Perhaps IE is being overly pernickety about the POST request. In the HTTP docs from www.w3.org, the POST request is described as a method to change the content of the server, and should be replied to with a 200 'OK' response, if the new content can't be identified with an URI. The files I'm uploading certainly can be identified by URI again, so I should do what the RFC suggests and return a 201 response, with a new URI. I'll try that tomorrow, and see if that fixes the problem.