Skip to content

Commit

Permalink
Merge pull request hyperledger#2824 from anonyome/gm/user-agent-patch
Browse files Browse the repository at this point in the history
patch for hyperledger#2781: User Agent header in doc loader
  • Loading branch information
dbluhm committed Mar 12, 2024
2 parents 31b486e + 27507d4 commit 63250d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aries_cloudagent/vc/ld_proofs/document_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import Dict, Optional
import urllib.parse as urllib_parse
from importlib import resources
from ...version import __version__

import requests
from pyld import jsonld
Expand Down Expand Up @@ -122,6 +123,7 @@ def download(self, url: str, options: Optional[Dict], **kwargs):
headers = options.get("headers")
if headers is None:
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")
Expand Down

0 comments on commit 63250d8

Please sign in to comment.