From eabb0fcce20399ac38a259ae3ca4d0901ee511eb Mon Sep 17 00:00:00 2001 From: ff137 Date: Fri, 10 May 2024 13:37:04 +0300 Subject: [PATCH] :art: utilise default values Signed-off-by: ff137 --- aries_cloudagent/vc/ld_proofs/document_downloader.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aries_cloudagent/vc/ld_proofs/document_downloader.py b/aries_cloudagent/vc/ld_proofs/document_downloader.py index aac93839e9..23d7290611 100644 --- a/aries_cloudagent/vc/ld_proofs/document_downloader.py +++ b/aries_cloudagent/vc/ld_proofs/document_downloader.py @@ -120,15 +120,15 @@ def download(self, url: str, options: Optional[Dict], **kwargs): {"url": url}, code="loading document failed", ) - headers = options.get("headers") - if headers is None: - headers = {"Accept": "application/ld+json, application/json"} + headers = options.get( + "headers", {"Accept": "application/ld+json, application/json"} + ) headers["User-Agent"] = f"AriesCloudAgent/{__version__}" response = requests.get(url, headers=headers, **kwargs) - content_type = response.headers.get("content-type") - if not content_type: - content_type = "application/octet-stream" + content_type = response.headers.get( + "content-type", "application/octet-stream" + ) doc = { "contentType": content_type, "contextUrl": None,