Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch for #2781: User Agent header in doc loader #2824

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending more discussion in #2781

response = requests.get(url, headers=headers, **kwargs)

content_type = response.headers.get("content-type")
Expand Down
Loading