You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/05/27 20:20:07 UTC

git commit: AMBARI-5902. Views: Set Accept header to "text/plain" for some requests. (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk b28d36184 -> 66d8d5bf7


AMBARI-5902. Views: Set Accept header to "text/plain" for some requests. (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/66d8d5bf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/66d8d5bf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/66d8d5bf

Branch: refs/heads/trunk
Commit: 66d8d5bf7b9e019bf8688bb9be915befa89562d0
Parents: b28d361
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue May 27 21:13:55 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue May 27 21:14:22 2014 +0300

----------------------------------------------------------------------
 .../slider/src/main/resources/ui/app/helpers/ajax.js | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/66d8d5bf/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
index d8b3d3b..05e78db 100644
--- a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
+++ b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
@@ -32,12 +32,20 @@ var urls = {
 
   'mapper.applicationTypes': {
     real: 'apptypes?fields=*',
-    mock: '/data/apptypes/all_fields.json'
+    mock: '/data/apptypes/all_fields.json',
+    headers: {
+      Accept : "text/plain; charset=utf-8",
+      "Content-Type": "text/plain; charset=utf-8"
+    }
   },
 
   'mapper.applicationApps': {
     real: 'apps/?fields=*',
-    mock: '/data/apps/apps.json'
+    mock: '/data/apps/apps.json',
+    headers: {
+      Accept : "text/plain; charset=utf-8",
+      "Content-Type": "text/plain; charset=utf-8"
+    }
   },
 
   'mapper.applicationStatus': {
@@ -101,7 +109,8 @@ var formatRequest = function (data) {
   var opt = {
     type: this.type || 'GET',
     dataType: 'json',
-    async: true
+    async: true,
+    headers: this.headers || {accepts: "application/json; charset=utf-8"}
   };
   if (App.get('testMode')) {
     opt.url = formatUrl(this.mock ? this.mock : '', data);