On Dec 9, 2003, at 12:51 AM, Geoff Beier wrote:
That is not a bad MIME type. FWIW, Camino rendered it properly on my box. A bad MIME type would be when the server sends Content-type: text/plain but magic(5) says that it looks like image/jpeg. A reasonable course of action would then be for the browser to either render based on the results of magic OR interact with the user asking for a decision.
So basically you have to download the file, or a significant portion of the file to work your magic magic right?
Suck to be on dialup.
AFAIK, the first few lines are enough for doing magic in most cases. If magic hasn't found the answer afer 1k or so, chances are it will never find it.
There are not so much filetypes around the internet (esp. served by asp, php etc) that magic runs into problems.
If I could do it, I would take the 1st kilobyte or so and feed it "file -i", which then returns sth. like "image/jpeg" or "application/x-gzip" or, if it can't determine the exact type, "text/plain"(for readable stuff) / "application/octet-stream"(else).
to the objections concerning malicious code in .jpg:
1. .jpeg /.jpg should not be sniffed by content, but by extension, if at all.
2. even if we would sniff it: "file -i" returns "application/octet-stream". So what? Camino safes that to disk, doesn't it? And where we go from there, is up to the user and SEP (He won't open it with Camino, most likely).
... just a few thoughts about the topic ...
Greetings . . . Martin _______________________________________________ Camino mailing list [EMAIL PROTECTED] http://mozdev.org/mailman/listinfo/camino
