Skip to content

Commit

Permalink
Add hash to server handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Oct 23, 2015
1 parent 6b536fd commit f16c794
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pritunl/handlers/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,18 @@ def server_put_post(server_id=None):
'error_msg': CIPHER_INVALID_MSG,
}, 400)

hash = None
hash_def = False
if 'hash' in flask.request.json:
hash_def = True
hash = flask.request.json['hash']

if hash not in HASHES:
return utils.jsonify({
'error': HASH_INVALID,
'error_msg': HASH_INVALID_MSG,
}, 400)

jumbo_frames = False
jumbo_frames_def = False
if 'jumbo_frames' in flask.request.json:
Expand Down Expand Up @@ -437,6 +449,7 @@ def server_put_post(server_id=None):
search_domain=search_domain,
otp_auth=otp_auth,
cipher=cipher,
hash=hash,
jumbo_frames=jumbo_frames,
lzo_compression=lzo_compression,
inter_client=inter_client,
Expand Down Expand Up @@ -506,6 +519,8 @@ def server_put_post(server_id=None):
svr.otp_auth = otp_auth
if cipher_def:
svr.cipher = cipher
if hash_def:
svr.hash = hash
if jumbo_frames_def:
svr.jumbo_frames = jumbo_frames
if lzo_compression_def:
Expand Down

0 comments on commit f16c794

Please sign in to comment.