INNER CODE UNIT · Python
get_timestamp
opentimestamps/opentimestamps-server · otsserver/backup.py:165
def get_timestamp(self):
commitment = self.path[len('/timestamp/'):]
try:
commitment = binascii.unhexlify(commitment)
except binascii.Error:
self.send_response(400)
self.send_header('Content-type', 'text/plain')
self.send_header('Cache-Control', 'public, max-age=31536000') # this will never not be an error!
self.end_headers()
self.wfile.write(b'commitment must be hex-encoded bytes')
return
try:
timestamp = self.calendar[commitment]
except KeyError:
self.send_response(404)
self.send_header('Content-type', 'text/plain')