From a5396915687d31058528afceb7aaf24bf550e159 Mon Sep 17 00:00:00 2001 From: "Johan.Bloemberg" Date: Wed, 5 Mar 2014 14:08:11 +0100 Subject: [PATCH] Fix content and response url on file uploads --- src/main/coffeescript/view/OperationView.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/coffeescript/view/OperationView.coffee b/src/main/coffeescript/view/OperationView.coffee index dedeeb2dfdd..4d091615ba4 100644 --- a/src/main/coffeescript/view/OperationView.coffee +++ b/src/main/coffeescript/view/OperationView.coffee @@ -278,7 +278,12 @@ class OperationView extends Backbone.View # puts the response data in UI showStatus: (response) -> - content = response.data + if response.content is undefined + content = response.data + url = response.url + else + content = response.content.data + url = response.request.url headers = response.headers # if server is nice, and sends content-type back, we can use it @@ -297,14 +302,14 @@ class OperationView extends Backbone.View code = $('').html(content) pre = $('
').append(code)
     else if /^image\//.test(contentType)
-      pre = $('').attr('src',response.url)
+      pre = $('').attr('src',url)
     else
       # don't know what to render!
       code = $('').text(content)
       pre = $('
').append(code)
 
     response_body = pre
-    $(".request_url", $(@el)).html "
" + response.url + "
" + $(".request_url", $(@el)).html "
" + url + "
" $(".response_code", $(@el)).html "
" + response.status + "
" $(".response_body", $(@el)).html response_body $(".response_headers", $(@el)).html "
" + JSON.stringify(response.headers, null, "  ").replace(/\n/g, "
") + "
"