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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
7ddb9c10
Commit
7ddb9c10
authored
Jun 02, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
downloadable: Always set content-disposition: inline when displaying inline
A previous operation might have poluted the request
parent
0b6e324a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderSimpleView.xml
..._skins/erp5_deferred_style_core/Base_renderSimpleView.xml
+8
-3
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.xml
...tem/portal_skins/erp5_deferred_style_core/Base_report.xml
+7
-2
product/ERP5/mixin/downloadable.py
product/ERP5/mixin/downloadable.py
+2
-0
No files found.
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderSimpleView.xml
View file @
7ddb9c10
...
@@ -62,9 +62,14 @@ if skin_name and skin_name != \'None\': # make_query serializes None as \'None\'
...
@@ -62,9 +62,14 @@ if skin_name and skin_name != \'None\': # make_query serializes None as \'None\'
with portal.Localizer.translationContext(localizer_language):\n
with portal.Localizer.translationContext(localizer_language):\n
report_data = getattr(context, deferred_style_dialog_method)(**params)\n
report_data = getattr(context, deferred_style_dialog_method)(**params)\n
\n
\n
attachment_name = [x[len(\' filename=\'):] for x in (request.RESPONSE.getHeader(\n
attachment_name_list = [x[len(\' filename=\'):] for x in (request.RESPONSE.getHeader(\n
\'content-disposition\') or \'\').split(\';\')\n
\'content-disposition\') or \'\').split(\';\')\n
if x.startswith(\' filename=\')][0]\n
if x.startswith(\' filename=\')]\n
if attachment_name_list:\n
attachment_name, = attachment_name_list\n
else:\n
assert \'inline\' in (request.RESPONSE.getHeader(\'content-disposition\') or \'\')\n
attachment_name = \'index.html\'\n
if attachment_name.startswith(\'"\'):\n
if attachment_name.startswith(\'"\'):\n
attachment_name = attachment_name[1:]\n
attachment_name = attachment_name[1:]\n
if attachment_name.endswith(\'"\'):\n
if attachment_name.endswith(\'"\'):\n
...
...
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.xml
View file @
7ddb9c10
...
@@ -82,9 +82,14 @@ with portal.Localizer.translationContext(localizer_language):\n
...
@@ -82,9 +82,14 @@ with portal.Localizer.translationContext(localizer_language):\n
report_method=dummyReportMethod,\n
report_method=dummyReportMethod,\n
form=portal.restrictedTraverse(form_path)))\n
form=portal.restrictedTraverse(form_path)))\n
\n
\n
attachment_name = [x[len(\' filename=\'):] for x in (request.RESPONSE.getHeader(\n
attachment_name
_list
= [x[len(\' filename=\'):] for x in (request.RESPONSE.getHeader(\n
\'content-disposition\') or \'\').split(\';\')\n
\'content-disposition\') or \'\').split(\';\')\n
if x.startswith(\' filename=\')][0]\n
if x.startswith(\' filename=\')]\n
if attachment_name_list:\n
attachment_name, = attachment_name_list\n
else:\n
assert \'inline\' in (request.RESPONSE.getHeader(\'content-disposition\') or \'\')\n
attachment_name = \'index.html\'\n
if attachment_name.startswith(\'"\'):\n
if attachment_name.startswith(\'"\'):\n
attachment_name = attachment_name[1:]\n
attachment_name = attachment_name[1:]\n
if attachment_name.endswith(\'"\'):\n
if attachment_name.endswith(\'"\'):\n
...
...
product/ERP5/mixin/downloadable.py
View file @
7ddb9c10
...
@@ -127,6 +127,8 @@ class DownloadableMixin:
...
@@ -127,6 +127,8 @@ class DownloadableMixin:
RESPONSE
.
setHeader
(
'Content-Disposition'
,
RESPONSE
.
setHeader
(
'Content-Disposition'
,
'attachment; filename="%s"'
%
filename
)
'attachment; filename="%s"'
%
filename
)
RESPONSE
.
setHeader
(
'Accept-Ranges'
,
'bytes'
)
RESPONSE
.
setHeader
(
'Accept-Ranges'
,
'bytes'
)
else
:
RESPONSE
.
setHeader
(
'Content-Disposition'
,
'inline'
)
return
str
(
data
)
return
str
(
data
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
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