Closed
Description
Username/password encoding in HTTP basic auth is currently broken for non-ASCII password.
Example with user user
and password unusual-char-é
. With curl it works as expected:
curl -v 'http://user:unusual-char-%C3%A9@localhost:5984/'
> GET / HTTP/1.1
> Authorization: Basic YWxpY2U6YWRyaWVuPTohw6k=
>
< HTTP/1.1 200 OK
But with couchdb-python the string is decoded from utf-8
then re-encoded into latin1
, causing an incorrect Authorization header:
url = 'http://user:unusual-char-%C3%A9@localhost:5984/'
couchdb.Server(url).version()
> GET / HTTP/1.1
> Authorization: Basic dXNlcjp1bnVzdWFsLWNoYXIt6Q==
>
< HTTP/1.1 401 Unauthorized
Metadata
Metadata
Assignees
Labels
No labels