From 7454929be0d761b87909f04e26a9cf61d85a5702 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Fri, 4 Feb 2022 09:26:25 -0500 Subject: [PATCH] Less code duplication. --- src/allmydata/storage/http_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index 8a1d03192..2dc133b52 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -238,7 +238,7 @@ class StorageClientImmutables(object): raise ClientException( response.code, ) - body = loads((yield response.content())) + body = yield _decode_cbor(response) remaining = RangeMap() for chunk in body["required"]: remaining.set(True, chunk["begin"], chunk["end"]) @@ -293,8 +293,8 @@ class StorageClientImmutables(object): url, ) if response.code == http.OK: - body = yield response.content() - returnValue(set(loads(body))) + body = yield _decode_cbor(response) + returnValue(set(body)) else: raise ClientException( response.code,