mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 11:16:24 +00:00
Explicitly tell the server that the client accepts CBOR.
This commit is contained in:
parent
106cc708a0
commit
0aa8089d81
@ -99,6 +99,8 @@ class StorageClient(object):
|
|||||||
into corresponding HTTP headers.
|
into corresponding HTTP headers.
|
||||||
"""
|
"""
|
||||||
headers = self._get_headers(headers)
|
headers = self._get_headers(headers)
|
||||||
|
|
||||||
|
# Add secrets:
|
||||||
for secret, value in [
|
for secret, value in [
|
||||||
(Secrets.LEASE_RENEW, lease_renew_secret),
|
(Secrets.LEASE_RENEW, lease_renew_secret),
|
||||||
(Secrets.LEASE_CANCEL, lease_cancel_secret),
|
(Secrets.LEASE_CANCEL, lease_cancel_secret),
|
||||||
@ -110,6 +112,10 @@ class StorageClient(object):
|
|||||||
"X-Tahoe-Authorization",
|
"X-Tahoe-Authorization",
|
||||||
b"%s %s" % (secret.value.encode("ascii"), b64encode(value).strip()),
|
b"%s %s" % (secret.value.encode("ascii"), b64encode(value).strip()),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Note we can accept CBOR:
|
||||||
|
headers.addRawHeader("Accept", CBOR_MIME_TYPE)
|
||||||
|
|
||||||
return self._treq.request(method, url, headers=headers, **kwargs)
|
return self._treq.request(method, url, headers=headers, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user