Report X-Timestamp header expected by rust sync code

This commit is contained in:
Ryan Kelly 2020-02-13 20:01:26 +11:00
parent 3ec996582a
commit b382b91c5d
No known key found for this signature in database
GPG Key ID: FB70C973A037D258

View File

@ -26,6 +26,7 @@ during the production deployment.
""" """
import os import os
import time
from cornice import Service from cornice import Service
from pyramid import httpexceptions from pyramid import httpexceptions
@ -91,6 +92,7 @@ def _token(request):
auth_policy = request.registry.getUtility(IAuthenticationPolicy) auth_policy = request.registry.getUtility(IAuthenticationPolicy)
token, key = auth_policy.encode_hawk_id(request, uid) token, key = auth_policy.encode_hawk_id(request, uid)
request.response.headers["X-Timestamp"] = str(int(time.time() * 100) / 100.0)
return { return {
'id': token, 'id': token,
'key': key, 'key': key,