Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No request url or response body data on file upload #413

Merged
merged 1 commit into from
Mar 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/main/coffeescript/view/OperationView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -297,14 +302,14 @@ class OperationView extends Backbone.View
code = $('<code />').html(content)
pre = $('<pre class="xml" />').append(code)
else if /^image\//.test(contentType)
pre = $('<img>').attr('src',response.url)
pre = $('<img>').attr('src',url)
else
# don't know what to render!
code = $('<code />').text(content)
pre = $('<pre class="json" />').append(code)

response_body = pre
$(".request_url", $(@el)).html "<pre>" + response.url + "</pre>"
$(".request_url", $(@el)).html "<pre>" + url + "</pre>"
$(".response_code", $(@el)).html "<pre>" + response.status + "</pre>"
$(".response_body", $(@el)).html response_body
$(".response_headers", $(@el)).html "<pre>" + JSON.stringify(response.headers, null, " ").replace(/\n/g, "<br>") + "</pre>"
Expand Down