Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
9720f8d8
Commit
9720f8d8
authored
Sep 07, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
web_manifest: set response content type explicitly for Web portal types
parent
66b4b55f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
bt5/erp5_web_manifest/SkinTemplateItem/portal_skins/manifest_renderjs_ui/WebPage_viewAsWeb.py
...em/portal_skins/manifest_renderjs_ui/WebPage_viewAsWeb.py
+4
-4
No files found.
bt5/erp5_web_manifest/SkinTemplateItem/portal_skins/manifest_renderjs_ui/WebPage_viewAsWeb.py
View file @
9720f8d8
...
...
@@ -14,13 +14,13 @@ web_content = web_page.getTextContent()
# set headers depending on type of script
if
(
portal_type
==
"Web Script"
):
response
.
setHeader
(
'Content-Type'
,
'application/javascript'
)
response
.
setHeader
(
'Content-Type'
,
'application/javascript
; charset=utf-8
'
)
elif
(
portal_type
==
"Web Style"
):
response
.
setHeader
(
'Content-Type'
,
'text/css'
)
response
.
setHeader
(
'Content-Type'
,
'text/css
; charset=utf-8
'
)
elif
(
portal_type
==
"Web Manifest"
):
response
.
setHeader
(
'Content-Type'
,
'text/cache-manifest'
)
response
.
setHeader
(
'Content-Type'
,
'text/cache-manifest
; charset=utf-8
'
)
else
:
if
(
mapping_dict
is
not
None
):
...
...
@@ -32,6 +32,6 @@ else:
# Only fetch code (html, js, css, image) and data from this ERP5, to prevent any data leak as the web site do not control the gadget's code
response
.
setHeader
(
"Content-Security-Policy"
,
"default-src 'none'; img-src 'self' data:; media-src 'self'; connect-src 'self'; script-src 'self' 'unsafe-eval'; font-src netdna.bootstrapcdn.com fonts.googleapis.com fonts.gstatic.com; style-src 'self' netdna.bootstrapcdn.com fonts.googleapis.com fonts.gstatic.com 'unsafe-inline' data:; frame-src 'self' https://jsbin.com data:;"
)
response
.
setHeader
(
'Content-Type'
,
'text/html'
)
response
.
setHeader
(
'Content-Type'
,
'text/html
; charset=utf-8
'
)
return
web_content
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