Make Sure Those 404 and 500 Responses Are Long Enough
Internet Explorer is a term you can’t stay indifferent to. Whenever you hear somebody say it, they either say it with a respectful awe, or they utter it with a developer’s pain. Today I was on the latter side of this indifference, when I fought a Wordpress bug.
Internet Explorer expects a minimum sized response content when receiving HTTP errors in the 400-500 area. If the content size received in the response is lower than this minimum, an arguably “Friendly HTTP Error Message” takes over, and displayed instead of the content.
This (rather obtrusive) behavior doesn’t go well with Wordpress wp_die() function, which is invoked on many occasions throughout the Wordpress code. This function sets the HTTP response status to 500, and then sends a very short html code containing any error message you’d like. These error messages are usually no more than a brief sentence, which results in a very small response content.
So take an IE7 browser, and try to post an empty comment on any Wordpress that is not upgraded to version 2.7 yet. See that friendly browser message? The same in Firefox produces the expected “Error: please type a comment.” message. Wordpress had already fixed this in 2.7 (you can copy their workaround) after some bug reports, but any installation prior to 2.7 which is still not upgraded (and many MU installations which always trail behind in the version releases) has this.
For any application other than Wordpress, be sure to go over this table of minimum content size for each HTTP status error code, and make sure your responses are long enough.
Apparently, sometimes being laconic is bad.
About this entry
You’re currently reading “Make Sure Those 404 and 500 Responses Are Long Enough,” an entry on Life Scaling
- Published:
- 2.17.09 / 3pm
- Category:
- Browsers, LAMP, Programming
- Tags:
- 404, 500, Content-Length, HTTP, IE7, Internet Explorer, Reponse, Status Code
Follow me on Twitter: @orensol
- Hey #AWS, how about improving EBS? Maybe change underlying hardware to SSD, and make it more predictable? http://j.mp/gRG2b9
- @sebastianstadil it is indeed beautiful. It really depends on your use case and space to put it. I don't like when a printer crowds my desk.
- @sebastianstadil get one with builtin wifi (like hp1102w). Then you can throw it off wherever it fits around the house/office.
- Facebook Engineering Blog is one of the most incredible things to read on the Internet. http://j.mp/e7gFjg
- @dvirsky hehe, I read it as two different girlfriends, which made your tweet much more heart warming.

I am Oren, and this is my blog. I am a techie entrepreneur, co-founder & CTO of
No comments
Jump to comment form | comments rss [?] | trackback uri [?]