[Web-SIG] HTTP headers encoding

Manlio Perillo manlio_perillo at libero.it
Thu Dec 3 20:33:19 CET 2009


Henry Precheur ha scritto:
> [...]
>> How is authorization username handled in common WSGI frameworks?
> 
> As far as I know, they don't handle this. They just return the string
> without dealing with the encoding issues.
> 
> I think there is no correct way of handling this, because 99% of
> username/password contain only ascii characters. A possible 'workaround'
> would be to limit yourself to the ascii charset. If you get a non-ascii
> character raise an Exception.
> 

Right now I'm doing a: username.decode('us-ascii', 'replace')



Regards  Manlio


More information about the Web-SIG mailing list