Commit ff9fc63f authored by Łukasz Nowak's avatar Łukasz Nowak

Follow 0a4c8ed8.

parent 0a4c8ed8
...@@ -151,6 +151,7 @@ class SlapTool(BaseTool): ...@@ -151,6 +151,7 @@ class SlapTool(BaseTool):
#################################################### ####################################################
def _isTestRun(self): def _isTestRun(self):
return False
if self.getPortalObject().MailHost.__class__.__name__ == 'DummyMailHost': if self.getPortalObject().MailHost.__class__.__name__ == 'DummyMailHost':
return True return True
return False return False
...@@ -280,15 +281,17 @@ class SlapTool(BaseTool): ...@@ -280,15 +281,17 @@ class SlapTool(BaseTool):
self._logAccess(user, user, '#access %s' % computer_id) self._logAccess(user, user, '#access %s' % computer_id)
result = self._getComputerInformation(computer_id, user, False) result = self._getComputerInformation(computer_id, user, False)
# Keep in cache server for 7 days if self.REQUEST.response.getStatus() == 200:
self.REQUEST.response.setStatus(200) # Keep in cache server for 7 days
self.REQUEST.response.setHeader('Cache-Control', self.REQUEST.response.setHeader('Cache-Control',
'public, max-age=1, stale-if-error=604800') 'public, max-age=1, stale-if-error=604800')
self.REQUEST.response.setHeader('Vary', self.REQUEST.response.setHeader('Vary',
'REMOTE_USER') 'REMOTE_USER')
self.REQUEST.response.setHeader('Last-Modified', rfc1123_date(DateTime())) self.REQUEST.response.setHeader('Last-Modified', rfc1123_date(DateTime()))
self.REQUEST.response.setBody(result) self.REQUEST.response.setBody(result)
return self.REQUEST.response return self.REQUEST.response
else:
return result
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getFullComputerInformation') 'getFullComputerInformation')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment