Ensure we always set Content-Length when getting the web_sync_timestamp

This is required by our own automirror scripts...
This commit is contained in:
Magnus Hagander
2011-11-07 16:04:47 +01:00
parent 72977ae59e
commit 1ab63a3d51

View File

@ -145,8 +145,10 @@ def system_information(request):
# Basically just a check that we can access the backend still...
@cache(seconds=30)
def sync_timestamp(request):
return HttpResponse(datetime.now().strftime("%Y-%m-%d %H:%M:%S\n"),
mimetype='text/plain')
s = datetime.now().strftime("%Y-%m-%d %H:%M:%S\n")
r = HttpResponse(s, mimetype='text/plain')
r['Content-Length'] = len(s)
return r
# List of all unapproved objects, for the special admin page
@login_required