Skip to content

Commit

Permalink
fix: update User-agent header used in http requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-jennings committed Nov 20, 2024
1 parent 2eb50e0 commit 6ea3a77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phable/http.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib.metadata
import json
import ssl
import urllib.error
Expand Down Expand Up @@ -84,6 +85,7 @@ def request(

request_data = json.dumps(data).encode()
headers["Content-Type"] = "application/json; charset=UTF-8"
headers["User-Agent"] = f"phable/{importlib.metadata.version('phable')}"

httprequest = urllib.request.Request(
url, data=request_data, headers=headers, method=method
Expand Down

0 comments on commit 6ea3a77

Please sign in to comment.