updated: 2002-07-25Hi,
Recently i saw some *.bmp's and archives filtered by proxo due to wrong mime types.
This was with Scott's "fix", and Mona's "missing" and "unknown" Content-Type filters active.
It happens very rarely, so for testing i set some extensions in the mime.ini of my local webserver to "unknown", nonsense, and empty.
I added the critical extensions to "MIME Fix List" and modified the "fix" filter to include Mona's.
It's easier to maintain, because now "missing" and "unknown" also depend on the list.
[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 = " "
Skip the &$LOG() thing for Prox below 4.3.
Watch out for word wrap.
It
entirely depends on a good "MIME Fix List". Here is the one i use
------- MIME Fix List.txt ----------
# Proxomitron4 URL killfile
# MIME type/file extension mapping
# by Paul Rupe
#
# NoAddURL
#
# $Header: E:/RCS/MIMEFixList.txt 1.3 2002/03/27 16:59:37 prupe Exp prupe $
#
# Blocklist for use with the "Content-Type: Fix MIME types based on URL"
# header filter. This file matches URL extensions to their proper MIME
# types.
#
# Get the latest version of this file from
#
http://www.geocities.com/u82011729/prox/blocklist.html# Based on MIME Fix List.txt included with Proxomitron.
#
# Format: extension $SET(0=correct/content-type)
#
# text/*
htm(l|) $SET(0=text/html)
js $SET(0=text/javascript)
css $SET(0=text/css)
# application/*
exe $SET(0=application/octet-stream)
zip $SET(0=application/zip)
rar $SET(0=application/x-rar-compressed)
pdf $SET(0=application/pdf)
swf $SET(0=application/x-shockwave-flash)
# image/*
jp(e|)g $SET(0=image/jpeg)
gif $SET(0=image/gif)
png $SET(0=image/png)
bmp $SET(0=image/bmp)
# video/*
avi $SET(0=video/msvideo)
asf $SET(0=video/x-ms-asf)
mp(e|)g $SET(0=video/mpeg)
mov $SET(0=video/quicktime)
# audio/*
mp3 $SET(0=audio/x-mpeg)
wav $SET(0=audio/x-wav)
# mid $SET(0=audio/mid)
# my additions in order to simplify filter set
# virgolamobile April 04, 2002
# txt $SET(0=text/html)
eml $SET(0=text/html)
xml $SET(0=text/html)
xsl $SET(0=text/html)
# by sidki 2002-06-05
mid $SET(0=audio/midi)
rmi $SET(0=audio/midi)
cab $SET(0=application/cab)
arc $SET(0=application/x-arc)
rar $SET(0=application/x-rar)
arj $SET(0=application/x-arj)
#gz $SET(0=application/x-gzip)
jar $SET(0=application/java-archive)
pac $SET(0=application/x-ns-proxy-autoconfig)
bat $SET(0=text/plain)
------------------------------------
Some notes on false positives:
If you use the variant for the beta version, you'll notice a lot of text/html to text/html hits.
That's because
every incoming extension matched in "MIME Fix List" is replaced.
That's most probably faster than doing a complicated check like:
if mime type of incoming file ext. != mime type of "MIME Fix List" ext. then ...
All 304's (Not Modified) trigger the filter, since an incoming 304 doesn't carry a Content-Type header (same for the "missing" filter).
I think there is no way to let proxo check the incoming HTTP/1.x line, that contains the response code.
BTW, previewing of longer posts doesn't seem to work here (also happened before).
edit: commented the gzip line, for reading of *.html.gz pages
edit: $LOG command moved to the matching expression
regards, sidki
Edited by - sidki3003 on 25 Jul 2002 20:07:54