Commit 801ffeb6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_json_rpc_api: hack the API to return a dict instead of json...

parent 948f9ea4
...@@ -25,13 +25,11 @@ ...@@ -25,13 +25,11 @@
# #
############################################################################## ##############################################################################
from App.Common import rfc1123_date
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from erp5.component.module.SlapOSCloud import _assertACI from erp5.component.module.SlapOSCloud import _assertACI
import json
class SoftwareInstanceJsonTypeMixin: class SoftwareInstanceJsonTypeMixin:
...@@ -146,13 +144,7 @@ class SoftwareInstanceJsonTypeMixin: ...@@ -146,13 +144,7 @@ class SoftwareInstanceJsonTypeMixin:
if revision: if revision:
result["api_revision"] = revision result["api_revision"] = revision
self.REQUEST.response.setHeader('Cache-Control', return result
'private, max-age=0, must-revalidate')
self.REQUEST.response.setHeader('Vary',
'REMOTE_USER')
self.REQUEST.response.setHeader('Last-Modified',
rfc1123_date(self.getModificationDate()))
return json.dumps(result, indent=2)
security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText') security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText')
def fromJSONText(self, json_content): def fromJSONText(self, json_content):
......
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