Commit c891eb8
committed
Quote password in URL
By default, the username and password are passed to each request to
the API using Basic authentication. From the `xmlrpc.client` doc:
```
Both the HTTP and HTTPS transports support the URL syntax extension for
HTTP Basic Authentication: http://user:pass@host:port/path. The user:pass
portion will be base64-encoded as an HTTP ‘Authorization’ header, and sent
to the remote server as part of the connection process when invoking an
XML-RPC method.
```
So this lib generate an URL containing the username and the password. If
the password contained some characters (cf
https://datatracker.ietf.org/doc/html/rfc3986.html#section-2.2), the URL
became invalid. By simply using `urllib.parse.quote` on the password,
the problem is solved.
From a quick test, Dokuwiki seems to remove special characters from
username so only the password requires quoting.
Setting the `cookieAuth` parameter would have prevented the problem. When
set, the session is kept using cookies (via the HTTP headers) and only
one call to the *login* endpoint is done (and the password is not
wrappred in the URL).
Fix #241 parent c1429d5 commit c891eb8
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
0 commit comments