-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 James Y Knight wrote: > On Apr 2, 2009, at 2:33 PM, Tres Seaver wrote: >> I don't understand why: if RFC2047 values are being passed as HTTP >> headers, then surely the server has enough information to decode them, >> and to ensure that they are re-encoded into the same encoding as all >> other WSGI enviornment variables (under Python 2.x). > > Just so long as the gateway server has an HTTP header parsing > implementation and global knowledge of all HTTP headers, including > private ones. > > Consider: > FooBar: =?utf-8?q?some-text?= > > Should that be decoded with RFC2047 rules? Answer: it depends. Does > the grammar for FooBar say that the contents is of type TEXT? Maybe it > just *looks* like an encoded-word but is actually just a sequence of > tokens and separators which have an entirely different meaning for > that header. You simply can't tell without the grammar for the FooBar > header.
A couple of things: - - That header is not even allowed by the HTTP RFC's, AFAIK. "Custom" headers need the 'X-' prefix. - - I could imagine a server option which disabled decoding for a specific subset of custom headers, but can't imagine needing it in any real application. - - Leaving the WSGI environment a hodgepodge of differently-encoded junk makes *every* application have to deal with that stuff. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ1Slm+gerLs4ltQ4RAtkvAJ9SM8P9YmB/D3JleoY/0C7kVMl5MgCbBMCb +YavShebeoJU5Ijjc394LCQ= =BuI3 -----END PGP SIGNATURE----- _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com