httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Korthof>
Subject [2.0 PATCH] mod_headers.c : allow percentage in headers
Date Wed, 07 May 2003 19:10:00 GMT
Hi --

The Header directive in mod_headers.c doesn't allow for embedded
percentage characters (%).  This can be useful for writing out values
encoded via MIME semantics: some MIME headers allow a character set
indicator -- RFC 2184 allows this in the Content-disposition header, for
the filename, to indicate the encoding of the bytes in the name.

The example that I have working (at least for IE ... Mozilla ignores the
relevant header, sadly) uses percentage characters to encode the data in
the filename -- this seems to be the safest approach when the characters
may be in an encoding other than what the client expects.  This produces
headers more or less like the following:

Content-disposition: attachment; filename*=utf-8'ja'%e7%a7%81%e3%81%ae%e3%83%86%e3%82%b9%e3%83%88%e8%a1%a8%e7%a4%ba.txt

(wrapping seems to be optional)

Anyway, I had to modify mod_headers.c to allow that behavior.  The
attached patch allows percentage characters to be included in Header
constant string values by doubling them up.  I reused an existing
function -- constant_item -- because that seems more or less consistent
with the design (it looks like all the tag formatting functions are
treated the same); and it works, at least in 2.0.45.  I didn't update
the generated .html.en doc for this -- just the .xml doc.

thanks --


View raw message