Search the web
Sign In
New User? Sign Up
new-httpd
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [2.0 PATCH] mod_headers.c : allow percentage in headers   Message List  
Reply | Forward Message #44063 of 56488 |
Ed Korthof wrote:
> 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 --
>
> Ed
>
>
> ------------------------------------------------------------------------
>
> Index: docs/manual/mod/mod_headers.xml
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/docs/manual/mod/mod_headers.xml,v
> retrieving revision 1.6
> diff -u -r1.6 mod_headers.xml
> --- docs/manual/mod/mod_headers.xml 11 Apr 2003 01:25:52 -0000 1.6
> +++ docs/manual/mod/mod_headers.xml 7 May 2003 19:01:27 -0000
> @@ -244,6 +244,10 @@
> <tr><td><code>%{FOOBAR}e</code></td>
> <td>The contents of the <a href="../env.html">environment
> variable</a> <code>FOOBAR</code>.</td></tr>
> +
> + <tr><td><code>%%</code></td>
> + <td>This syntax can be used to include a percentage sign (%) as
> + in a litteral character string.</td></tr>

litteral -> literal

+1 on the patch.

bill




Thu May 8, 2003 2:08 pm

bill@...
Send Email Send Email

Forward
Message #44063 of 56488 |
Expand Messages Author Sort by Date

... litteral -> literal +1 on the patch. bill...
Bill Stoddard
bill@...
Send Email
May 8, 2003
2:49 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help