mirror of
https://github.com/mozilla-services/syncserver
synced 2024-10-30 09:20:32 +00:00
Report X-Timestamp header expected by rust sync code
This commit is contained in:
parent
3ec996582a
commit
b382b91c5d
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user