Actions
Bug #7884
closed[Workbench] log viewer does not handle "redirect to keep-web" response
Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench
Target version:
Story points:
0.5
Description
The Log pane of a finished job does an AJAX request with a URL like this:
Accept:*/* https://workbench.4xphq.arvadosapi.com/collections/f5ab63b9f751ebceb3f58693a130ec62+83/4xphq-8i9sb-wub5wkrd85xaja0.log.txt
When keep-web is enabled, Workbench's response looks like this:
Content-Type:application/json; charset=utf-8 {"href":"https://download.4xphq.arvadosapi.com/c=f5ab63b9f751ebceb3f58693a130ec62-83/_/4xphq-8i9sb-wub5wkrd85xaja0.log.txt?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
The code in source:apps/workbench/app/views/jobs/_show_log.html.erb crashes at data.split()
because data is an Object, not a string:
$.ajax(logcollection_url, { headers: range_header }).
done(function(data, status, jqxhr) {
logViewer.filter();
addToLogViewer(logViewer, data.split("\n"), taskState);
At least two things should be fixed:
- The
$.ajax()
call should force the response to be treated as plain text regardless of whether the response looks like JSON or has a Content-Type header. - The Workbench download handler, when redirecting to keep-web, should bypass ApplicationController#redirect_to (in source:apps/workbench/app/controllers/application_controller.rb) and send a real HTTP redirect response.
Related issues
Actions