Commit b6b851c8 authored by Titouan Soulard's avatar Titouan Soulard

erp5_json_form: fix Content-Type and Cache-Control

parent 0dd8b174
......@@ -102,29 +102,30 @@ class JSONForm(JSONType, TextDocument):
control.append("max-age=3600")
control.append("private")
REQUEST.RESPONSE.setHeader("Cache-control", ", ".join(control))
REQUEST.RESPONSE.setHeader("Content-Type", "application/json")
return json.dumps(schema, indent=2).encode()
security.declarePublic("getOutputJSONSchema")
@UnrestrictedMethod
def getOutputJSONSchema(self, REQUEST=None):
def getOutputJSONSchema(self):
"""
Method to retrieve the expected JSON Schema for JSON input
"""
return self.returnSchema(
self.getOutputSchema(),
"/getOutputJSONSchema",
REQUEST
self.REQUEST
)
security.declarePublic("getInputJSONSchema")
@UnrestrictedMethod
def getInputJSONSchema(self, REQUEST=None):
def getInputJSONSchema(self):
"""
Method to retrieve the expected JSON Schema for JSON output
"""
return self.returnSchema(
self.getTextContent(),
"/getInputJSONSchema",
REQUEST
self.REQUEST
)
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