summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Oberheide <jon@oberheide.org>2012-09-24 01:11:20 -0400
committerJon Oberheide <jon@oberheide.org>2012-09-24 01:11:20 -0400
commit23ed70fe50c3bd44efcc5e601740d94b228f5c2b (patch)
tree71ad2a3d34dc7710218560e2e25863b659eb8162
parent3b890e663508d9b6d9ee3d708de09530bac722b4 (diff)
downloadopenvpn-duo-plugin-23ed70fe50c3bd44efcc5e601740d94b228f5c2b.tar.gz
openvpn-duo-plugin-23ed70fe50c3bd44efcc5e601740d94b228f5c2b.zip
add useragent
-rwxr-xr-xduo_openvpn.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/duo_openvpn.py b/duo_openvpn.py
index 90c0b49..6a09e55 100755
--- a/duo_openvpn.py
+++ b/duo_openvpn.py
@@ -33,7 +33,12 @@ def sign(ikey, skey, method, host, uri, params):
return 'Basic %s' % base64.b64encode(auth)
def call(ikey, skey, host, method, path, **kwargs):
- headers = {'Authorization':sign(ikey, skey, method, host, path, kwargs)}
+ sig = sign(ikey, skey, method, host, path, kwargs)
+
+ headers = {
+ 'Authorization': sig,
+ 'User-agent': 'duo_openvpn/1.0',
+ }
if method in [ 'POST', 'PUT' ]:
headers['Content-type'] = 'application/x-www-form-urlencoded'