comparison web/templog.py @ 85:3cd1ca6d0489

- Fix HTTPError - Add wsgi script
author Matt Johnston <matt@ucc.asn.au>
date Wed, 11 Jul 2012 23:42:24 +0800
parents 959e88c0bdfa
children ef59da811986
comparison
equal deleted inserted replaced
84:ccce79dcb316 85:3cd1ca6d0489
21 def update(): 21 def update():
22 enc_lines = request.forms.lines 22 enc_lines = request.forms.lines
23 mac = request.forms.hmac 23 mac = request.forms.hmac
24 24
25 if hmac.new(config.HMAC_KEY, enc_lines).hexdigest() != mac: 25 if hmac.new(config.HMAC_KEY, enc_lines).hexdigest() != mac:
26 raise HTTPError(code = 403, output = "Bad key") 26 raise bottle.HTTPError(code = 403, output = "Bad key")
27 27
28 lines = zlib.decompress(binascii.a2b_base64(enc_lines)).split('\n') 28 lines = zlib.decompress(binascii.a2b_base64(enc_lines)).split('\n')
29 29
30 log.parse(lines) 30 log.parse(lines)
31 31