From 86c83f0dcdcb324c43ea476fdd9129eac63b4f95 Mon Sep 17 00:00:00 2001 From: Javier Revillas Date: Sat, 18 Nov 2017 10:50:23 +0100 Subject: [PATCH] Fix JSON serialization relying on response content Signed-off-by: Javier Revillas --- gateway/assets/script/bootstrap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gateway/assets/script/bootstrap.js b/gateway/assets/script/bootstrap.js index 275cec95..3ee6992b 100644 --- a/gateway/assets/script/bootstrap.js +++ b/gateway/assets/script/bootstrap.js @@ -59,8 +59,8 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md $http(options) .then(function(response) { - if ($scope.invocation && $scope.invocation.contentType == "json") { - $scope.invocationResponse = JSON.stringify(response.data, -1, " "); + if (typeof response.data == 'object') { + $scope.invocationResponse = JSON.stringify(response.data, null, 2); } else { $scope.invocationResponse = response.data; } @@ -205,4 +205,4 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md fetch(); } -]); \ No newline at end of file +]);