From ea3acfee3395bb6ff74bafadcc2003e4164a93a2 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 29 Nov 2019 10:03:00 +1100 Subject: [PATCH] Ensure that API Explorer passes through necessary header --- ang/api4Explorer/Explorer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 5ecf08d362..a626e572dc 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -475,7 +475,11 @@ $http.get(CRM.url('civicrm/ajax/api4/' + $scope.entity + '/' + $scope.action, { params: angular.toJson(getParams()), index: $scope.index - })).then(function(resp) { + }), { + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }).then(function(resp) { $scope.loading = false; $scope.status = 'success'; $scope.result = [formatMeta(resp.data), prettyPrintOne(JSON.stringify(resp.data.values, null, 2), 'js', 1)]; -- 2.25.1