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
_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe:
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com