Closed ghost closed 8 years ago
Hi, Basic authentication isn't handled by the library, but you can use the custom headers context to add the missing headers:
with client._additional_headers({'Authorization' : 'Foo'}) as new_client:
new_client.method()
Yes I digged through code, even python xmlrpclib but I couldn't find the reason why it doesn't work in this fork, finally I falled back to original jsonrpclib because I'm not looking for trouble right now :)
Python xmlrpc lib at some point adds Authorization header to request, you sure you don't overwrite request headers with custom headers?
OK, I'll give it a look ASAP. Do you have a snippet that I could test ?
Great, not a snippet exactly but for creating a authenticated jsonrpc server you might find this useful https://gist.github.com/k1-hedayati/bbd4e15f4c5b34a2628ea9e79ae08bff
Please try the master version of the repository, as the required headers are no longer ignored.
Sorry I can't test it because I'm no longer using this fork and based my code from original repo, https://github.com/k1-hedayati/jsonrpclib
BTW thanks for fixing issue :)
OK. Tests are now fully passing on Travis, considering the issue fixed. Thanks for reporting it :)
It seems in forked version using basic authentication isn't possible, I used tcpdump to capture packets and jsonrpclib-plex didn't send Authorization header