Browse Source

merged #155, adding tiny user agent

Daniel Roesler 7 years ago
parent
commit
a5738ff017
1 changed files with 1 additions and 1 deletions
  1. 1 1
      acme_tiny.py

+ 1 - 1
acme_tiny.py

@@ -31,7 +31,7 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA, disable_check
     # helper function - make request and automatically parse json response
     # helper function - make request and automatically parse json response
     def _do_request(url, data=None, err_msg="Error", depth=0):
     def _do_request(url, data=None, err_msg="Error", depth=0):
         try:
         try:
-            resp = urlopen(Request(url, data=data, headers={"Content-Type": "application/jose+json"}))
+            resp = urlopen(Request(url, data=data, headers={"Content-Type": "application/jose+json", "User-Agent": "acme-tiny"}))
             resp_data, code, headers = resp.read().decode("utf8"), resp.getcode(), resp.headers
             resp_data, code, headers = resp.read().decode("utf8"), resp.getcode(), resp.headers
             resp_data = json.loads(resp_data) # try to parse json results
             resp_data = json.loads(resp_data) # try to parse json results
         except ValueError:
         except ValueError: