Author Topic: mime fix list doesn't fix this site  (Read 3355 times)

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« on: July 05, 2002, 12:01:06 AM »
hi all,
i found the site www peachpage com (add the dots) sent by the server as text/plain.
even with "fix mime type" header filter active (the standard one that comes with proxomitron with the paul rupe's list), it continue to be not filtered at all. i've filtered it activating the header filter "filter text/plain" but i would prefer to filter it using mime fix list, after all IT IS a web page, then the content-type would have to be fixed as text/html by "fix mime type".
so the question is: why "fix mime type" doesn't work?

someone have the right suggestion?

regards,
altosax.

 
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #1 on: July 05, 2002, 02:47:17 PM »
Hi altosax,

That URL (...com/) can't match the mime fix filter because it's triggered by extensions (*.htm(l|)).
You could try modifying the matching expression, like

Match = "(text/*|^?|unknown)1 $URL([^/]+*(.([a-z0-9]+{2,5}|/)(^?)&&$LST(MIME-List)))"

and adding this to the list
/(^?) $SET(0=text/html)

I can't test this because the site is down at the moment.

regards, sidki


 
 

pooms

  • Jr. Member
  • **
  • Posts: 75
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
mime fix list doesn't fix this site
« Reply #2 on: July 05, 2002, 04:09:19 PM »
Just a warning about the content on that site: you might not
want to visit that page if you are at work!

As sidki3003 mentions, the mime fix works by looking for extensions, and
there is none in this case. I was a bit surprised that the MIME Fix List
does not have an entry mapping .htm or .html to text/html. I'm guessing
that this is because some/most browsers do this automatically. Even with
altosax's page having no .htm or .html extension and the wrong mime type,
IE6 renders the HTML, although Opera just displays the raw HTML text.
I guess IE must also look into the content to decide it is HTML.

On the other hand, I notice that Jor's MIME Fix file has an entry
for the extension pattern "(?|)htm(l|)", so I guess some browsers must
have needed it.

 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #3 on: July 05, 2002, 09:49:32 PM »
hi all,
no way to solve my problem using an existing filter. tests on all modifies i've tryed failed. so i've made this new header filter:

In = TRUE
Out = FALSE
Key = "Content-Type: Fix the default page [vm] (In)"
URL = "[^/]+/(^?)"
Replace = "text/html$FILTER(True)"

it works in a different way from
Key = "Content-Type: Filter text/plain (In)"
because it applyes only to the default web page when url is www.somewhere.com/ with ending /, not to txt files. this way you can active filtering of text files or not as needed. but if you always have "filter text/plain" active you don't need this, but you need "filter text plain" placed after "fix mime types".

if someone will be able to merge this filter with an existing one he will make me happy. i'm constantly trying to simplify my filter set.

regards,
altosax.

<edit>: just to share this attempt (but i've tryed many, many more)
i've tryed to simplify "fix mime types" but this breaks sites:

In = TRUE
Out = FALSE
Key = "Content-Type: Fix MIME types (In)"
URL = "*.$LST(Mime-List)(^?)"
Match = "text/*"
Replace = ""


Edited by - altosax on 05 Jul 2002  22:59:32
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #4 on: July 05, 2002, 10:11:29 PM »
Hi altosax,

$FILTER(True) is not needed if you change the mime type to text/html.
The site is online again and this version of the mime fix filter works for me.

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

Again the addition to the mime fix list would be:
/(^?) $SET(0=text/html)


regards, sidki


 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #5 on: July 05, 2002, 10:33:54 PM »
now it works, thank you.
i'm sure i was wrong with the parens.

as i wrote,
you have made me happy :D

altosax.

<edit the first time>: here the additions i've made some days ago

# my new additions, July 02, 2002
asx $SET(0=audio/x-ms-asf)
au  $SET(0=audio/basic)
ico $SET(0=image/x-icon)
midi $SET(0=audio/mid)
ps  $SET(0=application/postscript)

regards.

<edit the second time>:
hey, i've just realized why: the parens you posted in your first message are different!!

Edited by - altosax on 05 Jul 2002  23:36:10

Edited by - altosax on 05 Jul 2002  23:40:00
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #6 on: July 05, 2002, 11:57:30 PM »
Yes, the +run needed to be separated from the next OR.
BTW, thanks for pointing out this */ problem .

 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #7 on: July 06, 2002, 12:09:14 PM »
hi sidki,
i'm experimenting now the modified version of the standard "fix mime types":

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

i've moved the url matching from "match" to "url" and really i don't know why this filter breaks hotmail background.
have you an hotmail account and some time to test it?
if you believe, alternatively, you can test a modified version of the yours one:

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

have you an answer?

<edit> removed wrong observation </edit>

regards,
altosax.



Edited by - altosax on 06 Jul 2002  13:42:59
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #8 on: July 06, 2002, 02:30:25 PM »
Hi altosax,

Sorry i have no hotmail account, but if you come across another site with the same problem i will test that.

edit: I think i found the answer: $SET() doesn't work in the URL match.

Your observation confused me . The posted filter works, but my last forward-slash suggestion broke some things.

So here is one that i just tested with unknown, missing, text/plain, final forward-slash, and *.extension. I hope i didn't miss anything this time :

Match = "(text/*|^?|unknown)1 $URL([^/]+*(.([a-z0-9]+{2,5})|/)((^?)&&$LST(MIME-List)))&$LOG(CHDR_In CT_fix: 1 to )"

The entry in the mime fix list changed too:
(^?) $SET(0=text/html)


regards, sidki




Edited by - sidki3003 on 06 Jul 2002  17:00:26
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
mime fix list doesn't fix this site
« Reply #9 on: July 06, 2002, 04:20:22 PM »
so it is the set command, well. i had an answer.

if you want to test it anyway, it breaks also the debug view (dbug..somesite).
btw i've abandoned it because that filter always calls the mime list, for every request made to the server. the standard one calls the list only when content-type matches, so it is faster.

also, for the same reason, i prefer the separate filter above to match the default page. it can be activated or disabled and not require the mime list to be scanned every time you send a request for a url like www.something.com/.

anyway, i'll give a chanche to your new version of fix mime types, playing with it for a while.

regards,
altosax.