Many of you are probably aware that the latest versions of Internet Explorer violate W3C specifications and ignore the Content-type: header of documents that are sent. Instead, IE examines the beginning of the document and attempts to infer what the content type should actually be. If you send the header "Content-type: image/gif", but you actually send a jpeg, or a tiff, IE will still render it correctly. That means that pages which render properly on IE may very well fail on other browsers.

Well, I just discovered a new (to me) facet of this problem. I have an administrative console for a Web site that clients know is only used with IE 5.0 or better. No reason to test it on other browsers, right? Wrong.

I recently discovered that the administrative console would not work on IE 5 on a MacOS 8.4. The access logs showed that my programs were getting called properly and returning 200 status codes. No entries were in the error log. Further research revealed that my security routines were still trapping violations behind the scenes. No pages would render, however. Here's the script which failed:

use CGI; use strict; use Template; use Foo::Security; use Foo::Utilities qw/dienice/; my $q = CGI->new; my $template = Template->new( { INCLUDE_PATH => '../templates', RELATIVE => 1 } ); my $section = $q->param( 'section' ) || ''; my $sec = Foo::Security->new; my $template_data = { security => $sec->ctl_data }; my $sections = $sec->get_sections; if ( ! grep { /$section/ } @$sections ) { $sec->send_to_login; } else { $template->process( "${section}-frame.tmpl", $template_data ) or d +ienice $template->error(); }

Notice anything funny about it? Anything, anything, Bueller?

Repeat after me: "Ovid is a moron". I never bothered to send a header. IE on Windows realized that the frameset had accidentally been included in the headers and rendered it properly. IE on a Mac didn't catch this and just rendered a blank page. I tested it on Navigator and got the message "Document contains no data." That told me instantly what happened. If IE had bothered to follow standards, I would have caught this bug months ago. Sigh.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Love/Hate Internet Explorer by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.