Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
19f98e6a
Commit
19f98e6a
authored
Mar 18, 2024
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_json_form: fix Content-Type and Cache-Control
parent
18f6cfa4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
bt5/erp5_json_form/ModuleComponentTemplateItem/portal_components/document.erp5.JSONForm.py
...tTemplateItem/portal_components/document.erp5.JSONForm.py
+5
-4
No files found.
bt5/erp5_json_form/ModuleComponentTemplateItem/portal_components/document.erp5.JSONForm.py
View file @
19f98e6a
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment