cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfred Nathaniel <>
Subject Backpatching mime type setting to 2.1.x
Date Wed, 02 Mar 2005 18:08:41 GMT
Currently in 2.1.x mime type setting on reader instances does not work.

  <map:match pattern="">
    <map:read src="foo.html" mime-type="text/plain"/>

returns Content-type: text/html because the <mime-mapping> for *.html in
web.xml always wins over the mime-type attributed.

This behaviour has been reported in [1] and Carsten looked at it at the
2003 Hackathon [2].  In a speed vote [3] it was decided to fix it only
in 2.2.

The arguments for not putting it into 2.1.x were:

a) it is incompatible [4]
b) no one really missed it [5]

Argument a) does not really hold.  It only affects people who currently
specify a mime-type different from the file extension and trust that it
is blissfully ignored.

Argument b) is also no longer valid.  Besides the original [1] there are

relating to the same problem.

Backpatching should be straightforward.  AFAIKS only
AbstractProcessingPipeline.setMimeTypeForReader and
setMimeTypeForSerializer must be copied from trunk to 2.1.x.  (SVN merge
cannot be used because there were too many changes in both branches).

If you agree to do the change, I am willing to provide the patch.


Cheers, Alfred.


View raw message