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):
# FIXME this duplicates a lot of code from ERP5's BigFile
# -> TODO reuse BigFile streaming capability without copying its code
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
# chunk out of our data.
# convert ranges from bytes to array indices
slice_index = REQUEST.get('slice_index', None)
if slice_index is not None:
RESPONSE.setHeader("Content-Type", "application/octet-stream")
slice_index_list = []
for index in slice_index:
slice_index_list.append(slice(index.get('start'),
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>DataArray</string> </value>
......@@ -46,9 +40,9 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:133, 42: Redefining built-in \'format\' (redefined-builtin)</string>
<string>W:165, 4: Redefining built-in \'range\' (redefined-builtin)</string>
<string>W:192, 10: No exception type(s) specified (bare-except)</string>
<string>W:145, 42: Redefining built-in \'format\' (redefined-builtin)</string>
<string>W:177, 4: Redefining built-in \'range\' (redefined-builtin)</string>
<string>W:203, 10: No exception type(s) specified (bare-except)</string>
</tuple>
</value>
</item>
......@@ -59,28 +53,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -93,7 +72,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -102,7 +81,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</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