Project

General

Profile

Bug #6754

Updated by Brett Smith over 8 years ago

h2. Problem 

 Workbench shows files from collections by piping from arv-get.    If arv-get can't download the file for any reason, Workbench returns a 200 OK status, with a 0-byte response. 

 h2. Fix 

 * Add an attribute to CollectionsController's FileStreamer class, and corresponding test stub classes, that captures the exit status of arv-get (@$?@).    Before arv-get is run, this attribute is @nil@. 
 * Near the end of CollectionsController#show_file, capture the FileStreamer created by file_enumerator.    Hook up its @each@ strings to @response.stream@ as we do now.    In the ensure block, if we haven't written any bytes to @response.stream@ and the arv-get exit attribute does not have status 0, set @response.status = 500@.

Back