The Un-Official Proxomitron Forum

Full Version: Separate Filtering per MIME-Type
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It's premature to request enhancements, particularly since I don't have time at the moment to code anything, and I am having problems with P'modo. [Seemingly random text insertion at the top of pages, crashes, ... under Opera 7.5 - I'll look into it later.]

However, this enhancement may have implications down the road and it might be nice to have an idea of how to incorporate it now in anticipation.

With Proxo, you could only edit TEXT/HTML MIME types (IMAGE/GIF also I guess to stop animation). This meant monkeying with the MIME type for other types which you would want to edit. This was Scott's approach and by and large worked well enough.

Now that there is an OpenSource solution, I think that it would be nice to have special filters for CSS and JavaScript files (as examples), without the need for changing the MIME type in incoming headers.

To that end, I'd like to propose a field in the filters for TEXT editing (provisionally MIMEType), which defaults to TEXT/HTML, but could be set to TEXT/CSS, TEXT/Plain, APPLICATION/X-JAVASCRIPT, etc. (with the provision of including multiple types) to allow one to edit incoming data which have these MIME types.

Thoughts?
I don't think it is accurate to say that you have to monkey with the MIME types to enable you to filter other content types.

By default, Proxomitron always filters a small set of MIME types, including text/html. Users can create header filters that selectively enable/disable filtering for pages with specific MIME types, using the $FILTER command.

The need to "monkey" with the MIME types is to try and make the Content-Type header have a value that reflects the true content type. Servers often don't set the Content-Type value correctly, so filters have been developed to change Content-Type by looking for file extensions in the URL.

You COULD use a filter to change the Content-Type to text/html as a way to force the content to be filtered, but that is not the right way to do it. $FILTER should be used.

The $TYPE command, or an $IHDR(Content-Type: ... ) command, can be used to further restrict what content a specific web filter will apply to.

So I think Proxo already does what you are asking, although it isn't the easiest to understand (witness threads on various proxo forums trying to figure out how to filter XML content B) )

However, there are deficiencies in the $TYPE command, since the code values you can provide must match a (non-standard) list of hardcoded values.
pooms;
Thanks for the information - that will help me in the future. I'm going to have to review the documentation and see what else is buried in there.

Curm.

Guest

It would be nice to have a feature/command to use a different configuration for different mime-types. I'm not sure if this is already there.
Please see here: "html debug info"
Reference URL's