Commit 633da9a1 authored by Ivan Tyagov's avatar Ivan Tyagov Committed by Nikola Balog

The default view of a "Data Array" returned always "Content-Type" header equal to

"application/octet-stream" whcih makes accessing object via ERP5-ish UI impossible.
The reason for this is that a call to _range_request_handler was always setting this "Content-Type" header.
This before switch to Zope4 remained unoticed. Fix now.
parent 2b12e7d4
...@@ -156,12 +156,12 @@ class DataArray(BigFile): ...@@ -156,12 +156,12 @@ class DataArray(BigFile):
# FIXME this duplicates a lot of code from ERP5's BigFile # FIXME this duplicates a lot of code from ERP5's BigFile
# -> TODO reuse BigFile streaming capability without copying its code # -> TODO reuse BigFile streaming capability without copying its code
def _range_request_handler(self, REQUEST, RESPONSE): def _range_request_handler(self, REQUEST, RESPONSE):
RESPONSE.setHeader("Content-Type", "application/octet-stream")
# HTTP Range header handling: return True if we've served a range # HTTP Range header handling: return True if we've served a range
# chunk out of our data. # chunk out of our data.
# convert ranges from bytes to array indices # convert ranges from bytes to array indices
slice_index = REQUEST.get('slice_index', None) slice_index = REQUEST.get('slice_index', None)
if slice_index is not None: if slice_index is not None:
RESPONSE.setHeader("Content-Type", "application/octet-stream")
slice_index_list = [] slice_index_list = []
for index in slice_index: for index in slice_index:
slice_index_list.append(slice(index.get('start'), slice_index_list.append(slice(index.get('start'),
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>DataArray</string> </value> <value> <string>DataArray</string> </value>
...@@ -46,9 +40,9 @@ ...@@ -46,9 +40,9 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:133, 42: Redefining built-in \'format\' (redefined-builtin)</string> <string>W:145, 42: Redefining built-in \'format\' (redefined-builtin)</string>
<string>W:165, 4: Redefining built-in \'range\' (redefined-builtin)</string> <string>W:177, 4: Redefining built-in \'range\' (redefined-builtin)</string>
<string>W:192, 10: No exception type(s) specified (bare-except)</string> <string>W:203, 10: No exception type(s) specified (bare-except)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -59,28 +53,13 @@ ...@@ -59,28 +53,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -93,7 +72,7 @@ ...@@ -93,7 +72,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -102,7 +81,7 @@ ...@@ -102,7 +81,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
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