Old Proxomitron Forums

Proxomitron Filters - Discussions welcome => Other => Topic started by: sidki3003 on July 25, 2002, 06:32:45 PM

Title: Fix Mime Type Fixes :)
Post by: sidki3003 on July 25, 2002, 06:32:45 PM
Hi all,

These fixes address two shortcomings in the "Fix MIME types" filter.

The first appears on pages with wrong mime types but no extension like:
www.somesite.com/
www.somesite.com/something

A thread about that is here (http://"http://asp.flaaten.dk/pforum/topic.asp?ARCHIVE=&TOPIC_ID=686").

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Type:Fix MIME types (no extension) (LOG) (In)"
URL = "^([^/]+*.([a-z0-9]+{1,5})(?|(^?)))"
Match = "(text/*|^?|unknown)1&$LOG(CHDR_In CT_NoExt fixed: 1)"
Replace = "text/html"

The second is for URLs containing a query string with extension like:
http://www.somesite.com/something.htm?something.jpg

Since .jpeg is in the mime fix list of most config distributions (*not* the default one), the page won't be rendered as HTML.
This is the fix for my version (http://"http://asp.flaaten.dk/pforum/topic.asp?ARCHIVE=&TOPIC_ID=592").

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Type: 1 Fix MIME types (mod S3) (LOG) (In)"
Match = "(text/*|^?|unknown)1 $URL([^/]+*.([a-z0-9]+{2,5}&&$LST(MIME-List))(?|(^?)))&$LOG(CHDR_In CT_Ext fixed: 1 to )"
Replace = ""

and this for the default version

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Type: Fix MIME types (In)"
Match = "text/* $URL([^/]+*.([a-z0-9]+{2,5}&&$LST(MIME-List))(?|(^?)))"
Replace = ""

Skip the &$LOG() thing for Prox below 4.3.
Watch out for word wrap.

BTW, the new code tag doesn't allow editing (but it's nice ).

regards, sidki


Edited by - sidki3003 on 26 Jul 2002  04:34:21
Title: Fix Mime Type Fixes :)
Post by: Arne on July 25, 2002, 06:50:35 PM
It is an old experiment I did a few months ago. It sneaked in while I had to reupload files getting damaged on the server. I have found the original one now and uploaded the correct one.

The other one I had been experimenting with locally, was not finished. I had even forgotten about it LOL. I might take it up again one day and finish it. It did look kind of good though And this reminded me where I left off that night - at the editing point.

Best wishes
Arne
Imici username= Arne