[Web-SIG] WSGI for Python 3
Christoph Zwerschke
cito at online.de
Fri Aug 27 18:05:15 CEST 2010
Am 27.08.2010 16:22 schrieb Armin Ronacher:
> For an all bytes approach a tool would have to recognize that this is
> from a WSGI environment and change the code to this:
>
> if b'msie' in request.META.get('HTTP_USER_AGENT', b'').lower():
Btw, another problem with this is that the lower() method does not know
that it has to use latin1 when lowercasing. For instance,
user = 'özkan'.encode('latin1')
if user in request.META.get('REMOTE_USER', b'').lower():
will not work it the user has logged in as 'Özkan'.
-- Christoph
More information about the Web-SIG
mailing list