Commits

Matthew Schinckel  committed 9776941

Use microsecond accuracy on Last-Modified header, even though this is not part of the HTTP spec. This means we can better handle concurrent users of the API affecting each others' data.

  • Participants
  • Parent commits 8d43c85

Comments (0)

Files changed (2)

File rest_api/http.py

 from serializers import serialize
 from django.db.models.query import QuerySet
 from django.conf import settings
+import logging
 
 class BaseHttpResponse(django.http.HttpResponse, Exception):
     def __init__(self, *args, **kwargs):
         newest = getattr(self.raw_data[0], mod_field)
         for obj in self.raw_data:
             newest = max(newest, getattr(obj, mod_field))
-        self['Last-Modified'] = newest.strftime('%a, %d %b %Y %X GMT').strip()
+        self['Last-Modified'] = newest.strftime('%a, %d %b %Y %X.%f GMT').strip()
 
         
 class Deleted(OK):

File rest_api/middleware.py

         ))
         if int(response.status_code) > 401:
             logging.debug("Request: \n%s" % request.raw_post_data)
-            # logging.debug("Response: \n%s" % response.content)
+            logging.debug("Response: \n%s" % response.content)
         return response
     
     def process_exception(self, request, exception):