Ensure we always set Content-Length when getting the web_sync_timestamp
authorMagnus Hagander <magnus@hagander.net>
Mon, 7 Nov 2011 15:04:47 +0000 (16:04 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 7 Nov 2011 15:04:47 +0000 (16:04 +0100)
This is required by our own automirror scripts...

pgweb/core/views.py

index 6fa5f3cac6f5c0f160a5954412726ab6245ba273..6d23e1affd628a51486f84ec833f96302f35da4e 100644 (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