From 7457b2027d744dcde6747b9c25ad975f6207ee4b Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Mon, 3 Nov 2014 22:52:17 -0800 Subject: [PATCH] smarter content type detection --- src/main/coffeescript/view/OperationView.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/coffeescript/view/OperationView.coffee b/src/main/coffeescript/view/OperationView.coffee index 1ca7286f..253363a5 100644 --- a/src/main/coffeescript/view/OperationView.coffee +++ b/src/main/coffeescript/view/OperationView.coffee @@ -376,7 +376,11 @@ class OperationView extends Backbone.View headers = response.headers # if server is nice, and sends content-type back, we can use it - contentType = if headers && headers["Content-Type"] then headers["Content-Type"].split(";")[0].trim() else null + contentType = null + if headers + contentType = headers["Content-Type"] or headers["content-type"] + if contentType + contentType = contentType.split(";")[0].trim() if !content code = $('').text("no content")