Skip to content

Commit 457261f

Browse files
workaround for bug in node api
Signed-off-by: Laurent Martin <laurent.martin.l@gmail.com>
1 parent 98b991b commit 457261f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/aspera/rest.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ def call(
458458
# Log.log.debug{"result: body=#{result_http.body}"}
459459
result_data = result_http.body
460460
Log.dump(:result_data_raw, result_data, level: :trace1)
461+
# TODO: Remove next 2 lines when bug in async node api is fixed. (Aspera/core/issues/4490)
462+
node_api_bug = result_data&.index('}HTTP/1.1 400 Bad Request') if result_data.is_a?(String)
463+
result_data = result_data[0..node_api_bug] if node_api_bug
461464
result_data = JSON.parse(result_data) if Mime.json?(result_mime) && !result_data.nil? && !result_data.empty?
462465
Log.dump(:result_data, result_data)
463466
RestErrorAnalyzer.instance.raise_on_error(req, result_data, result_http)

0 commit comments

Comments
 (0)